Skip to content
MediumVulnerability

GHSA-5h93-6whr-6q8j: Model Context Protocol Python SDK: HTTP client transports followed cross-origin redirects carrying custom headers and bodies

Published
Record updated
View JSON
Affected
  • mcp >= 1.8.0, < 1.30.0, fixed in 1.30.0
  • mcp >= 2.0.0, < 2.2.0, fixed in 2.2.0
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.

Summary

The Model Context Protocol Python SDK's Streamable HTTP and SSE client transports, and its OAuth client providers, followed HTTP redirects to any host. Custom headers such as an X-API-Key credential were sent to the redirect target, and on 307 or 308 redirects the request body was re-sent too, while a lone Authorization bearer header was dropped by the HTTP library. Affected versions are 1.8.0 through 1.29.1 and 2.0.0 through 2.1.1, and exploitation requires a trusted endpoint to redirect to a different origin.

Mitigation

Upgrade to mcp 1.30.0 (1.x) or 2.2.0 (2.x) or later; no code changes are needed. Until upgrading, supply your own HTTP client with follow_redirects left at False (http_client= on streamable_http_client; httpx_client_factory= on sse_client and streamablehttp_client), and rotate any credentials a client may have sent to a host you do not control.