Skip to main content

MCP Python SDK CVE-2026-59950

| EUVDEUVD-2026-44798 HIGH
Origin Validation Error (CWE-346)
2026-07-15 GitHub_M GHSA-vj7q-gjh5-988w
7.6
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker hosts malicious web page
  2. Delivery
    Victim browser loads the page
  3. Exploit
    Script opens cross-origin WebSocket to local MCP server
  4. Execution
    Handshake accepted without Origin/Host check
  5. Impact
    Drive MCP tool calls to read/exfiltrate data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Origin validation
Exploitation Conditions

Exploitation requires that the target application expose the deprecated mcp.server.websocket.websocket_server transport from mcp < 1.28.1 (applications using only SSE or Streamable HTTP transports are not affected). The attacker cannot connect directly server-to-server in the general case: the CVSS UI:P/AT:P metrics indicate a victim must load attacker-controlled content in a browser that then performs a cross-origin (and/or DNS-rebinding) WebSocket handshake to the MCP endpoint, which the server accepts with no Host or Origin validation. Limiting factors: only the deprecated WebSocket transport is vulnerable; the MCP server must be network-reachable from the victim's browser (commonly a localhost/loopback binding); user interaction (visiting the malicious page) is required; and even after patching, protection is only active if the operator passes TransportSecuritySettings, since the default remains permissive for backward compatibility.

Impact

The supplied CVSS 4.0 vector (CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N, score 7.6) captures the shape of this well: network reachable and unauthenticated (PR:N), but gated by an attack requirement (AT:P) and passive user interaction (UI:P) - i.e., a victim must load attacker content in a browser, and the target must run the specific deprecated transport. High confidentiality and integrity impact (VC:H/VI:H) reflect that a hijacked MCP session can read and invoke tools. This is not a wormable, drive-by unauthenticated RCE despite the network vector; the AT:P and UI:P conditions meaningfully constrain it. No EPSS score, no KEV listing, and no POC were provided, so real-world exploitation pressure appears low-to-moderate and opportunistic rather than mass-scale. Note a scope nuance: the practical impact lands on the application's own MCP tools rather than the SDK's process privileges, so downstream severity depends heavily on what tools the exposed server offers. Prioritize based on whether you actually use the deprecated WebSocket transport - most deployments on SSE/Streamable HTTP are unaffected.

Exploit ScenarioDerived

A developer runs an MCP-enabled application that exposes the deprecated websocket_server transport on localhost. The developer visits an attacker-controlled web page, whose JavaScript opens a cross-origin WebSocket to ws://127.0.0.1:<port>/ws with subprotocol 'mcp'; because no Origin check is applied, the handshake succeeds and the page drives MCP tool calls to read data or trigger actions. No POC was provided, and the passive user interaction plus DNS-rebinding-style attack requirement (UI:P/AT:P) mean the attacker must lure the victim's browser rather than hit the server directly.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 15, 2026

Cross-origin WebSocket hijacking in the Model Context Protocol Python SDK (mcp on PyPI) before 1.28.1 lets a remote web page connect to any application exposing the deprecated mcp.server.websocket.websocket_server transport, because that transport accepted handshakes without Host or Origin validation and offered no SDK-level control to restrict connecting origins. A malicious site loaded in a victim's browser can therefore open an MCP session against a locally reachable server and drive its tools. There is no public exploit identified at time of analysis, and the issue is not listed in CISA KEV; the tags flag it as information disclosure.

RemediationAI

Vendor-released patch: 1.28.1 - upgrade the mcp PyPI package to 1.28.1 or later (pip install --upgrade 'mcp>=1.28.1'). After upgrading, explicitly pass security_settings to websocket_server using TransportSecuritySettings(enable_dns_rebinding_protection=True, allowed_hosts=[...], allowed_origins=[...]) so Host/Origin validation is actually enforced, since the default still accepts any origin to preserve backward compatibility (as the added test test_ws_security_default_settings confirms). If you cannot upgrade immediately, the strongest compensating control is to stop using the deprecated WebSocket transport and migrate to the Streamable HTTP or SSE transports, which already support TransportSecurityMiddleware; alternatively, place a reverse proxy in front of the endpoint that rejects WebSocket handshakes whose Origin is not in an allowlist and validates the Host header (trade-off: adds proxy configuration and can break legitimate clients if the allowlist is too narrow), and bind the server strictly to loopback with host firewall rules to limit reachability (trade-off: prevents intended remote clients). See the fix in PR #2992 (https://github.com/modelcontextprotocol/python-sdk/pull/2992) and commit 777b8d06710c140e3606b0d4598e2aa48546c266.

Affected VersionsENISA

python-sdk < 1.28.1

Affected Packages

pypi mcp fix: 1.28.1
euvd python_sdk fix: 1.28.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in pypi, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The Model Context Protocol (MCP) is a JSON-RPC-based standard for connecting LLM clients to tool/resource servers, and the mcp package is its reference Python implementation offering several server transports (Streamable HTTP, SSE, and the now-deprecated raw WebSocket transport). The SSE and Streamable HTTP transports route requests through TransportSecurityMiddleware (TransportSecuritySettings with allowed_hosts/allowed_origins and DNS-rebinding protection), but websocket_server bypassed this layer entirely. The root cause is CWE-346 (Origin Validation Error): the WebSocket handshake was accepted regardless of the Host or Origin header, so a browser on any origin could establish a session. The PR #2992 fix threads a security_settings parameter into websocket_server and calls security.validate_request(...) before accepting the handshake, rejecting mismatched Host/Origin with an HTTP 403 pre-accept close. The affected component is cpe:2.3:a:modelcontextprotocol:python-sdk:*.

Know when Python Sdk gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.6 HIGH
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
vuln.today AI 6.8 MEDIUM

Network-reachable and unauthenticated (PR:N), but AC:H and UI:R reflect the required cross-origin/DNS-rebinding setup and a victim loading attacker content; high C/I on hijacked MCP tools, no availability impact.

3.1 AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N
4.0 AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
Passive
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Jul 15, 2026 - 22:33 EUVD
CVE Published
Jul 15, 2026 - 20:08 cve.org
HIGH 7.6

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

The Model Context Protocol (mcp) Python SDK contains a cross-origin WebSocket hijacking vulnerability affecting versions before 1.28.1; malicious websites can hijack MCP sessions and execute arbitrary tools against locally running servers. Organizations deploying vulnerable mcp versions expose tool execution capabilities to browser-based attacks requiring no authentication to the server. A vendor patch is available.

Business Impact: High
Compensating Controls

Apply vendor patch: upgrade mcp to version 1.28.1 or later.

Threat Intelligence Overview

EPSS Score
0.2%
Top 92% exploitable
Prevalence
Medium
widely adopted AI SDK, but only the deprecated WebSocket transport is affected
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Open
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy