MCP TypeScript client SDK follows cross-origin redirects and resends request headers and request bodies, fixed in 1.32.0 and 2.3.0
MCP TypeScript client SDK: HTTP client transports and OAuth requests followed cross-origin redirects and re-sent custom headers and request bodies
A GitHub security advisory discloses that the HTTP transport and OAuth requests of the MCP TypeScript client SDK follow redirects pointing to arbitrary origins, causing the target origin to receive custom request headers (such as X-API-Key set via requestInit.headers) and the mcp-session-id header. Affected versions are all versions of @modelcontextprotocol/sdk before 1.32.0, and @modelcontextprotocol/client from 2.0.0 to before 2.3.0; applications using StreamableHTTPClientTransport, SSEClientTransport, or OAuth client functions such as auth() are affected, while stdio clients are not affected.
The advisory explains which MCP client configurations leak custom request headers and request bodies cross-origin, and gives specific measures for upgrading, key rotation, and temporary workarounds.