CVE-2026-59951: MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion
In affected versions, a Streamable HTTP server in stateful mode (the default) never reclaimed session state:
- sessions did not expire;
- a client
DELETEended the session but left its entry registered; - a session whose first request was refused stayed registered with a running task.
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.
References
- github.com/advisories/GHSA-84m7-p3x7-pcfv
- github.com/modelcontextprotocol/python-sdk/commit/92120b4b0f50385af096592d7cee932fc1d994e7
- github.com/modelcontextprotocol/python-sdk/commit/d2290ca3434731b68ea3e2270bc06a6e6575931b
- github.com/modelcontextprotocol/python-sdk/pull/3395
- github.com/modelcontextprotocol/python-sdk/pull/3426
- github.com/modelcontextprotocol/python-sdk/releases/tag/v1.30.0
- github.com/modelcontextprotocol/python-sdk/releases/tag/v2.2.0
- github.com/modelcontextprotocol/python-sdk/security/advisories/GHSA-84m7-p3x7-pcfv
- nvd.nist.gov/vuln/detail/CVE-2026-59951
Code Behaviors & Features
Detect and mitigate CVE-2026-59951 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →