---
schema_version: '1.0'
id: security-20261016-c2e615
title: 'CVE-2026-59951: MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP
  Transport Enables Resource Exhaustion'
url: https://osv.dev/vulnerability/GHSA-84m7-p3x7-pcfv
url_hash: c2e6151ae232592c4bb9dec062b1d9afbca15b23d0b5910a1fadcbbfa392546f
canonical_url: https://osv.dev/vulnerability/GHSA-84m7-p3x7-pcfv
source: osv:ghsa
category: security/library
category_raw: cve/library
region: null
tags:
- cve
- CVE-2026-59951
- GHSA-84m7-p3x7-pcfv
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- mcp
- PyPI
lang: en
published_at: '2026-10-15T20:13:13Z'
fetched_at: '2026-10-16T11:21:45.355110Z'
updated_at: '2026-10-16T13:02:17Z'
status: published
content_hash: 0d0cad040bc16a28e63e39d21c02ed26afff5a9169ceb715d77be6d56b2c4a63
content_changed_at: null
license_note: full
summary: 'MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport
  Enables Resource Exhaustion'
summary_source: rss
summary_en: 'MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport
  Enables Resource Exhaustion'
summary_omitted_reason: null
redistribution: true
keywords_en:
- Accumulation
- cve
- CVE-2026-59951
- Enables
- Exhaustion
- GHSA-84m7-p3x7-pcfv
- library vulnerability
- mcp
- PyPI
- Python
- Python 3.15.0
- Resource
- SDK
- Session
- severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- software security
- StreamableHTTP
- Transport
- Unbounded
entities_en:
- name: Python 3.15.0
  type: version_number
topics_en:
- library vulnerability
- software security
numeric_facts: []
entities:
- name: Python 3.15.0
  type: version_number
key_facts: []
related: []
related_auto: []
computed_at: '2026-10-16T13:02:08Z'
---

# CVE-2026-59951: MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion

## TL;DR
MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion

## Key Points
- cve / CVE-2026-59951 / GHSA-84m7-p3x7-pcfv / severity:CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H / mcp / PyPI

## Details
**Severity:** CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
**Advisory:** GHSA-84m7-p3x7-pcfv (CVE-2026-59951)

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

- sessions did not expire;
- a client `DELETE` ended 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.

### 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:

- `FastMCP` (1.x)
- `MCPServer` and `Server.streamable_http_app()` (2.x)
- `StreamableHTTPSessionManager`

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

Not affected:

- servers on 1.12.0 or later passing `stateless_http=True` (no sessions are kept)
- servers using only the stdio or SSE transports

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:

- a session with no request in flight for `session_idle_timeout` seconds (default 1800) is closed and its ID then answers `404`; open streams and in-progress requests keep it alive;
- at most `max_sessions` sessions exist at once (default 10000); a request that would open another is answered `503`;
- a session is discarded as soon as it ends, whether by `DELETE`, expiry, or a refused opening request.

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:**
- https://github.com/modelcontextprotocol/python-sdk/security/advisories/GHSA-84m7-p3x7-pcfv
- https://nvd.nist.gov/vuln/detail/CVE-2026-59951
- https://github.com/modelcontextprotocol/python-sdk/pull/3395
- https://github.com/modelcontextprotocol/python-sdk/pull/3426
- https://github.com/modelcontextprotocol/python-sdk/commit/92120b4b0f50385af096592d7cee932fc1d994e7
- https://github.com/modelcontextprotocol/python-sdk/commit/d2290ca3434731b68ea3e2270bc06a6e6575931b
- https://github.com/modelcontextprotocol/python-sdk
- https://github.com/modelcontextprotocol/python-sdk/releases/tag/v1.30.0
- https://github.com/modelcontextprotocol/python-sdk/releases/tag/v2.2.0

_Data: OSV.dev (upstream: ghsa) — https://osv.dev/vulnerability/GHSA-84m7-p3x7-pcfv_

## Source
元記事: [CVE-2026-59951: MCP Python SDK: Unbounded Session Accumulation in StreamableHTTP Transport Enables Resource Exhaustion](https://osv.dev/vulnerability/GHSA-84m7-p3x7-pcfv) — published 2026-10-15T20:13:13Z
