Skip to content

AAK-MCP-TSSDK-CVE-2026-111769-001: MCP TypeScript SDK client: HTTP transports and OAuth requests send headers and bodies across a cross-origin redirect

Severity
MEDIUM
Category
Supply Chain (supply-chain)
Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py
Auto-fixable
No.
SARIF name
McpTypeScriptSdkCrossOriginRedirect

What it detects

The official MCP TypeScript SDK's HTTP client transports (StreamableHTTPClientTransport, SSEClientTransport) and its OAuth client requests, such as auth(), followed a redirect to any origin. That origin received the custom request headers, such as an API key set in requestInit.headers, and mcp-session-id, and on a 307 or 308 the request body, which for an OAuth token request holds the refresh_token and client_secret. A malicious or compromised MCP or authorization server could collect them (CVE-2026-111769, CVSS 3.1 6.5, CWE-200, GHSA-6prh-2h8m-c8cw). Current runtimes already drop the Authorization header across origins, and stdio clients are not affected. It affects every @modelcontextprotocol/sdk release before 1.32.0 and @modelcontextprotocol/client 2.0.0 up to 2.3.0. Checked in the npm tarballs: 0.4.0, the first release, already posts through fetch with its default redirect handling, the SSE client takes custom headers from 1.1.0, and the OAuth client ships in 1.6.0. 1.32.0 and 2.3.0 follow a redirect only within the origin, and not at all in browsers (modelcontextprotocol/typescript-sdk#2901 and #2902).

How to fix

Upgrade @modelcontextprotocol/sdk to 1.32.0 or later, or on 2.x @modelcontextprotocol/client to 2.3.0 or later, and pin it. Do not set redirectPolicy: 'follow' on a transport, which restores the exposure; if a server redirects to another origin on purpose, configure the final URL instead. If you cannot upgrade yet, pass the transports a fetch that refuses redirects (one that calls fetch with redirect: 'error'). If a redirect may have reached a host you do not control, rotate the API keys and client_secret the application held and revoke its tokens.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-TSSDK-CVE-2026-111769-001

Limitations

Reports @modelcontextprotocol/sdk below 1.32.0 and @modelcontextprotocol/client from 2.0.0 up to 2.3.0 where a package.json, lockfile or MCP config states the version, reporting a range that admits an affected version. latest of each is fixed and states no version, so it is not reported. Releases before 1.1.0 send no custom headers and have no OAuth client, so there only a 307 or 308 re-sends a message body; they are reported, as the advisory scopes it. It reads the version, not the code: an MCP server built on the SDK, or a client that speaks only stdio, is reported without being exposed, and a fixed release with redirectPolicy: 'follow' set, which restores the exposure, is not reported. A file over 2 MB, or a lockfile over 32 MiB, is not read. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-TSSDK-CVE-2026-111769-001.md: the page then shows that text, with the registry reference appended under it.