CVE-2026-59950

MCP Python SDK: WebSocket server transport does not support Host/Origin validation

Published Jul 15, 2026 CVSS 4.0 · 7.6 High EPSS < 1% KEV · Not listed
Description
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.websocket_server 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.

Analysis

AI-generated

Technical impact

The MCP Python SDK, distributed on PyPI as mcp, implements the Model Context Protocol. In versions prior to 1.28.1 the deprecated websocket_server transport accepted WebSocket handshakes without performing Host or Origin header validation. This omission means that any WebSocket client can establish a connection to an application that exposes this transport, bypassing any application‑level origin restrictions. The weakness is consistent with CWE-1385 for missing validation and CWE-346 for insecure handling of external input.

Affected Systems

Users of the Model Context Protocol Python SDK who run versions earlier than 1.28.1 are affected, specifically those using the deprecated websocket_server transport. The issue is limited to the SDK; the host application may not check origins, leaving the choice to the SDK.

Risk and Exploitability

The CVSS score of 7.6 signals high severity. An EPSS score of less than 1% indicates a low probability of exploitation currently, and the vulnerability is not listed in CISA KEV. Based on the description, it is inferred that exploiting the vulnerability requires network access to the host that exposes the websocket_server endpoint. If an attacker can reach the endpoint, they can initiate a WebSocket handshake without Host or Origin checks, which could be used to connect to unauthorized services or exfiltrate data depending on the application’s logic.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the MCP Python SDK to version 1.28.1 or later, which enforces Host/Origin header validation.
  • If an upgrade cannot be performed immediately, disable the deprecated websocket_server transport to eliminate the insecure handshake path.
  • Deploy network controls, such as firewall rules or reverse‑proxy host checks, to restrict which origins may reach the WebSocket service.

Generated by OpenCVE AI on July 31, 2026 at 02:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-vj7q-gjh5-988w MCP Python SDK: WebSocket server transport does not support Host/Origin validation
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Modelcontextprotocol
Modelcontextprotocol python-sdk
Vendors & Products Modelcontextprotocol
Modelcontextprotocol python-sdk
Type Values Removed Values Added
Description 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.websocket_server 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.
Title MCP Python SDK: WebSocket server transport does not support Host/Origin validation
Weaknesses CWE-1385
CWE-346
References
Metrics cvssV4_0

{'score': 7.6, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-1385

    Missing Origin Validation in WebSockets

  • CWE-346

    Origin Validation Error

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 17, 2026, 12:28 PM
Reserved
Jul 7, 2026, 6:49 PM
Status
Analyzed
Published
Jul 15, 2026, 9:16 PM
Modified
Oct 24, 2026, 9:10 PM