Skip to content

HTTP server transports and OAuth endpoints read request bodies with no size limit

High
maxisbey published GHSA-fmmv-w9g8-j3gc Sep 30, 2026

Package

pip mcp (pip)

Affected versions

< 1.29.1
>= 2.0.0, < 2.1.0

Patched versions

1.29.1
2.1.0

Description

Summary

In affected versions, an MCP server built with this SDK read the whole body of every HTTP request into memory before checking its size. One large request grew the process's memory by two to three times the size of the body, so a client that could reach the server over HTTP could exhaust its memory and take it offline, repeatedly. No credentials are needed against the OAuth endpoints, or against a server that does not require authentication (the default).

Am I affected?

Yes, if clients you do not fully trust can reach your server over HTTP and it runs:

  • 1.x before 1.29.1, or
  • 2.0.0 or 2.0.1.

The limit arrived in two steps:

  • 1.29.0 and 2.0.0 added a 4 MiB limit to the Streamable HTTP endpoint only.
  • 1.29.1 and 2.1.0 extended it to the SSE transport's message endpoint and the OAuth authorization server routes (/token, /register, /revoke, /authorize).

Not affected:

  • servers that only use the stdio transport
  • MCP clients
  • deployments behind a reverse proxy or gateway that already caps request body size

Fix

Upgrade to mcp 1.29.1 (1.x) or 2.1.0 (2.x) or later. There is no fixed 2.0.x release.

Every HTTP endpoint the SDK provides then reads the body through one shared limit (default 4 MiB) and answers 413 as soon as a request declares or streams more than that, before any parsing.

If your clients send single messages larger than 4 MiB, raise the limit with max_request_body_size=:

  • 1.x: FastMCP(..., max_request_body_size=...)
  • 2.x: MCPServer.run(), streamable_http_app(), sse_app()
  • or StreamableHTTPSessionManager / SseServerTransport when you construct them yourself

Code that drives StreamableHTTPServerTransport directly, without the session manager, does not get the limit and should bound request bodies itself. If you cannot upgrade yet, cap request body size in a reverse proxy or ASGI middleware in front of the server.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

CVE ID

No known CVE

Weaknesses

Allocation of Resources Without Limits or Throttling

The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. Learn more on MITRE.

Credits