MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
- Product
- mcp
- CVE
- CVE-2026-59951
- Affected
- mcp 1.8.0 to 1.29.1 and 2.0.0 to 2.1.1
- Fixed in
- 1.30.0 (1.x) and 2.2.0 (2.x)
Last verified against sources: October 26, 2026
Am I affected?
mcp: affected mcp 1.8.0 to 1.29.1 and 2.0.0 to 2.1.1. Fixed in 1.30.0 (1.x) and 2.2.0 (2.x).
- Check your version: run
pip show mcp. Versions >= 1.8.0, < 1.30.0 of mcp are affected. [1]
What to do now
- Upgrade to the fixed version: run
pip install --upgrade "mcp>=1.30.0"(first patched version 1.30.0). [1] - Upgrade to mcp 1.30.0 (1.x) or 2.2.0 (2.x) or later. [1]
- If you cannot upgrade yet, pass stateless_http=True (1.12.0 or later) where you need no per-session state. [1]
- Or restrict who can reach the endpoint. [1]
- On a small host, lower session_idle_timeout, max_sessions and max_request_body_size to fit. [1]
General practice, not from the source: if the affected software could read tokens or credentials, rotate them after upgrading; pin versions and review changes before updating tools your agents run.
What happened
Impact
What was done
- The fix is in mcp 1.30.0 (1.x) and 2.2.0 (2.x). [1]
- In those versions, a session with no request in flight for session_idle_timeout seconds (default 1800) is closed and its ID then answers 404. [1]
- At most max_sessions sessions exist at once (default 10000); a request that would open another is answered 503. [1]
- A session is discarded as soon as it ends, whether by DELETE, expiry, or a refused opening request. [1]
Sources
- GHSA-84m7-p3x7-pcfv — GitHub Advisory Database
Every statement above was checked against these sources before publishing. Spotted an error? Tell us and we will correct it with a dated note.
Share advisory brief with your team
Copy a plain-text summary for Slack, GitHub issues, or team security channels.
[CVE-2026-59951] MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
Product: mcp | Affected: mcp 1.8.0 to 1.29.1 and 2.0.0 to 2.1.1 | Fixed in: 1.30.0 (1.x) and 2.2.0 (2.x)
Summary: In affected versions, a Streamable HTTP server in stateful mode (the default) never freed session state.
Source & remediation on AgentArmorHQ: https://agentarmorhq.com/incidents/2026/10/cve-2026-59951-mcpCorrections
Report an error or request a correction. We review requests within 5 business days and add a dated correction note.
Discussions for CVE-2026-59951
Ask questions or share configuration tips. Governed by our Community Rules & Terms.
No posts match this filter yet.
Be the first to ask a question or share a working tip.