INCIDENT MAP

Browse / MCP and Tool Server Flaws / CVE-2026-59951

MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion

CVE-2026-59951 ยท 2026-10-15 moderate

Class
MCP and Tool Server Flaws (filed by a model that read the advisory)
Technique
Denial of service
Also involves
Unbounded Consumption
Affected
mcp (PyPI)
CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
0.5% chance of exploitation in 30 days

How it works, in short

Streamable HTTP sessions are never expired or capped, so a client opening many short sessions grows server memory without limit. (Our summary, written by a model. The source text is below.)

Details

Summary

In affected versions, a Streamable HTTP server in stateful mode (the default) never reclaimed session state:

Each session also kept its parsed initialize parameters, and the number of sessions was unlimited. A client that could reach the endpoint could grow server memory without bound using ordinary short requests; only a restart reclaimed it.

Am I affected?

Yes, if you serve MCP over Streamable HTTP in stateful mode and clients you do not fully trust can reach the endpoint. Stateful mode is the default for:

Affected versions: 1.8.0 through 1.29.1, and 2.0.0 through 2.1.1.

Not affected:

Authentication limits who can open sessions, not how many a token holder can open.

Fix

Upgrade to mcp 1.30.0 (1.x) or 2.2.0 (2.x) or later. In those versions:

Both settings are keyword arguments on FastMCP(...) (1.x), MCPServer.run() / streamable_http_app() (2.x) and StreamableHTTPSessionManager; None disables them.

This bounds retention rather than eliminating it: a live session still holds its initialize parameters (up to roughly twice the 4 MiB body limit), and an initialize with invalid parameters still opens a session that expires like any other. On a small host, lower session_idle_timeout, max_sessions and max_request_body_size to fit.

If you cannot upgrade yet, pass stateless_http=True (1.12.0 or later) where you need no per-session state, or restrict who can reach the endpoint.

References

Source: GitHub Advisory Database, used under CC BY 4.0.