# CVE-2026-59951: MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion

> Attackers can exhaust server memory via unbounded session accumulation in stateful Streamable HTTP transports, causing denial of service.

- **Severity:** Medium 6.9 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 14 Oct 2026
- **Updated:** 15 Oct 2026
- **Also known as:** ECHO-4e93-dae6-642f, GHSA-84m7-p3x7-pcfv, MINI-2352-675j-3jpr, MINI-2m9m-qvmr-jvg6, MINI-37p3-mq97-9qc9, MINI-53r2-p5q2-75gq, MINI-6ghv-ph7r-7v5v, MINI-73pm-qw4c-7jp2, MINI-78cq-jvf5-p4cm, MINI-7m33-c285-mh4g, MINI-f2ph-c9h7-rhq9, MINI-fr3x-32qq-2xc3, MINI-gv96-5cm7-w7v8, MINI-gvpw-chfx-68f5, MINI-h84g-8h94-f528, MINI-hcc8-wx3f-mjcg, MINI-m683-hp42-6p89, MINI-pxm5-c9jm-r4p7, MINI-rrp2-p96g-gfpp

## What is CVE-2026-59951?

CVE-2026-59951 is a medium-severity denial of service vulnerability in modelcontextprotocol python-sdk, published on 14 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

The MCP Python SDK, called mcp on PyPI, is a Python implementation of the Model Context Protocol (MCP). From 1.8.0 until 1.30.0 and 2.2.0, stateful Streamable HTTP servers, including FastMCP, MCPServer, Server.streamable_http_app(), and StreamableHTTPSessionManager, retain session entries without an idle expiration or aggregate session-count limit. DELETE, refused opening requests, and completed sessions do not reliably discard their entries, and each entry can retain parsed initialize parameters. A client that can reach the endpoint can therefore create ordinary short requests that grow server memory without bound until restart. Stateless HTTP, stdio, and SSE transports are not affected. This issue is fixed in versions 1.30.0 and 2.2.0.

Weakness: CWE-772 (Missing Release of Resource after Effective Lifetime), CWE-400 (Uncontrolled Resource Consumption)

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

4 open source packages ship an affected version, including mcp.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mcp` | PyPI | From 1.8.0 | 1.30.0 |
| `mcp` | PyPI | From 1.8.0 | 1.30.0 |
| `mcp` | PyPI | From 2.0.0 | 2.2.0 |
| `mcp` | PyPI | From 2.0.0 | 2.2.0 |

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

Upgrade mcp to a fixed version for your release line: 1.30.0 or 2.2.0.

## Is CVE-2026-59951 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2026-59951 is a medium-severity denial of service vulnerability in modelcontextprotocol python-sdk, published on 14 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-59951 in the wild and no public exploit code.

Affected packages and fixed versions:
- mcp (PyPI): affected from 1.8.0; fixed in 1.30.0
- mcp (PyPI): affected from 1.8.0; fixed in 1.30.0
- mcp (PyPI): affected from 2.0.0; fixed in 2.2.0
- mcp (PyPI): affected from 2.0.0; fixed in 2.2.0

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-59951/ (Markdown: https://insights.sbomify.com/CVE-2026-59951/index.md)
```

## Sources

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

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