CVE-2026-59950: MCP Python SDK: WebSocket server transport does not support Host/Origin validation

Published Jul 15, 2026
·
Updated

Summary In affected versions, the deprecated WebSocket server transport (mcp.server.websocket.websocketserver) accepted the WebSocket handshake without applying any Host or Origin header validation. The TransportSecuritySettings mechanism that the SSE and Streamable HTTP transports use for this purpose was not wired into the WebSocket transport, so there was no SDK-level way to restrict which origins could connect.

Am I affected? Only if a developer's application server exposes mcp.server.websocket.websocketserver. This transport has never been part of the MCP specification, is marked deprecated, and is not reachable through FastMCP — a developer must have wired it into an ASGI application themselves. Servers using stdio, SSE, or Streamable HTTP are not affected by this advisory.

Details websocketserver() constructed a Starlette WebSocket and called accept(subprotocol="mcp") immediately, with no inspection of the connection's headers. By contrast, SseServerTransport and StreamableHTTPServerTransport accept an optional securitysettings: TransportSecuritySettings and run TransportSecurityMiddleware.validaterequest() against the incoming Host and Origin headers before establishing a session. Because browsers attach an Origin header to cross-origin WebSocket upgrade requests but do not enforce a same-origin policy on the response, a web page served from any origin could open a WebSocket to a reachable MCP server on this transport, complete the initialize handshake, and issue JSON-RPC requests on the resulting session.

Impact A user who runs an MCP server on this transport bound to localhost or a LAN address, without a separate authentication or origin gate in front of it, and visits a malicious web page, can have that page enumerate and invoke the server's tools and read its resources. The consequences depend entirely on what the server exposes. The transport itself requires no token or prior session. Some browsers prompt before allowing a public page to open a connection to a local-network address, which adds a user-interaction step but is not a substitute for server-side validation.

Mitigation Upgrade to version 1.28.1 or later, in which websocketserver() accepts the same optional securitysettings: TransportSecuritySettings argument as the other HTTP-based transports and validates the Host and Origin headers before accepting the handshake; a request that fails validation is rejected with HTTP 403 and ValueError("Request validation failed") is raised to the caller. As with the other transports the parameter defaults to None, which leaves validation disabled, so upgrading alone does not change behaviour: pass a TransportSecuritySettings with enablednsrebindingprotection=True and appropriate allowedhosts / allowedorigins to receive the protection. The recommended path remains to migrate off this deprecated transport to Streamable HTTP, where FastMCP enables this protection automatically for localhost binds. The WebSocket transport has been removed entirely in v2.

Other sources

The MCP Python SDK, called mcp on PyPI, is a Python implementation of the Model Context Protocol (MCP). Prior to 1.28.1, the deprecated mcp.server.websocket.websocketserver transport accepted WebSocket handshakes without applying Host or Origin header validation, leaving no SDK-level way to restrict which origins could connect to applications that exposed that transport. This issue is fixed in version 1.28.1.

MITRE

Affected Software

3 affected componentsFixes available
mcp MCP Python SDK<1.28.1
pip/mcp<1.28.1
1.28.1
Lfprojects Mcp Python Sdk<1.28.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/mcp to a version that resolves this vulnerability.

    Fixed in 1.28.1
  2. Upgrade

    Upgrade mcp (MCP Python SDK) to a version that resolves this vulnerability.

    Fixed in 1.28.1
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.28.1
  4. Configuration

    When using the deprecated WebSocket transport (mcp.server.websocket.websocket_server), pass a TransportSecuritySettings with enable_dns_rebinding_protection=True and appropriate allowed_hosts / allowed_origins, since the default parameter value None leaves validation disabled.

    mcp.server.websocket.websocket_server security_settings (TransportSecuritySettings) = enable_dns_rebinding_protection=True; allowed_hosts/allowed_origins set to trusted values

Event History

Jul 15, 2026
CVE Published
via MITRE·08:08 PM
Data Sourced
via MITRE·08:08 PM
DescriptionWeakness
Data Sourced
via NVD·09:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Jul 16, 2026
Advisory Published
via GitHub·08:14 PM
Data Sourced
via GitHub·08:14 PM
DescriptionWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-59950?

CVE-2026-59950 has a high severity rating of 7.6 according to the CVSS 4.0 scoring system.

2

What vulnerabilities are associated with CVE-2026-59950?

CVE-2026-59950 is associated with the lack of Host and Origin header validation in the WebSocket server transport of the MCP Python SDK.

3

How do I fix CVE-2026-59950?

To fix CVE-2026-59950, update to a version of the MCP Python SDK that implements proper Host and Origin validation.

4

Which software is affected by CVE-2026-59950?

CVE-2026-59950 affects the MCP Python SDK, specifically the deprecated WebSocket server transport.

5

When was CVE-2026-59950 published?

CVE-2026-59950 was published on July 15, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203