Impact
The MCP Python SDK (mcp on PyPI) contains a flaw in its stateful Streamable HTTP servers, such as FastMCP and MCPServer, where session entries are not expired or limited once they are created. Each session retains parsed initialization parameters and lives indefinitely unless it is the result of a DELETE, refused opening request, or a completed session that does not reliably discard its entry. The bug allows a client that can reach the endpoint to submit short requests that continually add new session entries, causing the server’s memory consumption to grow without bound. This uncontrolled memory growth can eventually exhaust system resources and crash the service, leading to a denial of service.
Affected Systems
The vulnerability affects the MCP Python SDK package named mcp released via PyPI. Vulnerable releases include versions 1.8.0 through 1.29.x and 2.0.0 through 2.1.x. The fix was incorporated in release 1.30.0 and 2.2.0. The issue only applies to stateful Streamable HTTP servers; stateless HTTP, stdio, and SSE transports are unaffected.
Risk and Exploitability
The CVSS score of 6.9 indicates moderate severity. Because there is an EPSS score of <1% and the vulnerability is not listed in the CISA KEV catalog, the current public exploitation probability is low but not zero. The attack vector is any client with network access to the affected endpoint, and the impact scales with the number of session creations. The flaw is a classic case of uncontrolled resource consumption (CWE-400) and lack of resource cleanup (CWE-772).
OpenCVE Enrichment
Github GHSA