Medium (AgentArmorHQ estimate)Supply chain

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

  1. Upgrade to the fixed version: run pip install --upgrade "mcp>=1.30.0" (first patched version 1.30.0). [1]
  2. Upgrade to mcp 1.30.0 (1.x) or 2.2.0 (2.x) or later. [1]
  3. If you cannot upgrade yet, pass stateless_http=True (1.12.0 or later) where you need no per-session state. [1]
  4. Or restrict who can reach the endpoint. [1]
  5. 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.

Discuss this incident

What happened

  • In affected versions, a Streamable HTTP server in stateful mode (the default) never freed session state. [1]
  • Sessions did not expire. [1]
  • A client DELETE ended a session but left its entry registered. [1]
  • Each session kept its parsed initialize parameters, and the number of sessions was unlimited. [1]

Impact

  • A client that could reach the endpoint could grow server memory without bound using ordinary short requests. [1]
  • Only a restart reclaimed the memory. [1]

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

  1. 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.

Brief
[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-mcp
Was this page useful?

Corrections

Report an error or request a correction. We review requests within 5 business days and add a dated correction note.

10 to 2,000 characters. A link to a source helps. Stored as plain text.

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.

Check before you install

Paste a package name or a GitHub link and get a clear answer in seconds: Block, Review or No known issues. No account needed.

Check a package

Questions? Contact us