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

> The MCP Python SDK WebSocket transport lacks Host/Origin validation, allowing unauthorized origins to connect to exposed applications.

- **Severity:** High 7.6 (`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`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 15 Jul 2026
- **Updated:** 17 Jul 2026
- **Also known as:** CLEANSTART-2026-FX89856, ECHO-754d-bf5b-8082, GHSA-vj7q-gjh5-988w, MINI-2q8x-779m-mhj2, MINI-45q8-xr38-hch6, MINI-4m66-qrgr-p4f8, MINI-6hp9-q5f8-cgr2, MINI-8265-xv5m-8gqv, MINI-9rh6-mf8q-8mw5, MINI-c4h8-pgvv-grhm, MINI-f665-xrmg-pp9w, MINI-p73h-3x4q-qccm, MINI-pj67-pvj7-62p4, MINI-qx7f-ghw8-7cj6, MINI-v7hm-6hfq-24gj, MINI-wjfw-rrv2-vcg2, MINI-x37v-9wqr-cqhq, MINI-x58c-vqqv-r7x7, MINI-xp5v-hp7v-fvc7, MINI-xqx5-q3rp-q72v, MINI-xrc5-5846-wqqm, PYSEC-2026-3483, ROOT-APP-PYPI-CVE-2026-59950

## What is CVE-2026-59950?

CVE-2026-59950 is a high-severity missing authorization vulnerability in modelcontextprotocol python-sdk, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official 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.

Weakness: CWE-346 (Origin Validation Error), CWE-1385 (Missing Origin Validation in WebSockets)

## Which versions are affected by CVE-2026-59950?

3 open source packages ship an affected version, including mcp. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mcp` | PyPI | All versions | 1.28.1 |
| `mcp` | PyPI | All versions | 1.28.1 |
| `mcp` | PyPI | All versions | 1.28.1 |

Products: Lfprojects Mcp Python Sdk.

## How do I fix CVE-2026-59950?

Upgrade mcp to 1.28.1 or later.

## Is CVE-2026-59950 being exploited?

There is no known exploitation of CVE-2026-59950 in the wild and no public exploit code.

## Other vulnerabilities in modelcontextprotocol python-sdk

- [CVE-2026-52870](https://insights.sbomify.com/CVE-2026-52870/): MCP Python SDK: Experimental task handlers allow any client to access and cancel other clients' tasks (high 7.6)
- [CVE-2025-66416](https://insights.sbomify.com/CVE-2025-66416/): DNS Rebinding Protection Disabled by Default in Model Context Protocol Python SDK for Servers Running on Localhost (high 7.6)
- [CVE-2026-52869](https://insights.sbomify.com/CVE-2026-52869/): MCP Python SDK: HTTP transports serve session requests without verifying the authenticated principal (high 7.1)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-59950 and fix it if it is affected.

What it is: CVE-2026-59950 is a high-severity missing authorization vulnerability in modelcontextprotocol python-sdk, published on 15 Jul 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-59950 in the wild and no public exploit code.

Affected packages and fixed versions:
- mcp (PyPI): affected all versions; fixed in 1.28.1
- mcp (PyPI): affected all versions; fixed in 1.28.1
- mcp (PyPI): affected all versions; fixed in 1.28.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-59950/ (Markdown: https://insights.sbomify.com/CVE-2026-59950/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-59950
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-59950
- OSV: https://osv.dev/vulnerability/CVE-2026-59950

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-59950/
Summaries are generated and may contain mistakes; the official description above is the record.
