Packages

ModerateVulnerabilityGHSA-6prh-2h8m-c8cwCVE-2026-111769Published 20 Oct 2026

MCP TypeScript client SDK: HTTP client transports and OAuth requests followed cross-origin redirects and re-sent custom headers and request bodies

Affected releases · @modelcontextprotocol/client

  • 2.x2.0.0 – 2.2.0Fixed in 2.3.0

On 2.x, the newest line:

npm install @modelcontextprotocol/client@2.3.0
  1. Affected

    2.0.0 – 2.2.0

    3 releases

  2. Fixed

    2.3.0 – 2.3.1

    2 releases, latest

5 stable releases of @modelcontextprotocol/client, oldest to newest.

Affected releases · @modelcontextprotocol/sdk

  • 1.x1.0.0 – 1.31.0Fixed in 1.32.0
  • 0.7.x and older0.4.0 – 0.7.0No fix, no longer updated

On 1.x, the newest line:

npm install @modelcontextprotocol/sdk@1.32.0
1.x
  1. Affected

    1.0.0 – 1.31.0

    75 releases

  2. Fixed

    1.32.0 – 1.32.1

    2 releases, latest

0.x
  1. Affected

    0.4.0 – 0.7.0

    5 releases

82 stable releases of @modelcontextprotocol/sdk, oldest to newest, one row per major.

Is your project affected?

Paste your package.json, or type the range you declare for @modelcontextprotocol/client. It is read in your browser and sent nowhere.

Is your project affected?

Paste your package.json, or type the range you declare for @modelcontextprotocol/sdk. It is read in your browser and sent nowhere.

What happens

Summary

In affected versions, the SDK's HTTP client transports and OAuth requests followed redirects to any origin.

If an MCP server or authorization server redirected a request to another origin, that origin received custom request headers (such as an X-API-Key set in requestInit.headers) and the mcp-session-id header. On a 307 or 308 it also received the request body, including OAuth token requests with their refresh_token and client_secret.

On current runtimes fetch already drops the Authorization header across origins.

Am I affected?

Yes, if your application uses StreamableHTTPClientTransport, SSEClientTransport, or the SDK's OAuth client functions such as auth(). stdio clients are not affected.

Affected versions:

Fix

Upgrade to:

Redirects are now followed only within the same origin, and not at all in browsers. If your MCP server or authorization server redirects to another origin on purpose, configure the final URL instead. Setting redirectPolicy: 'follow' on a transport restores the old behaviour and the exposure.

If a redirect may have reached a host you do not control, rotate the API keys and client_secret your application held and revoke its tokens.

If you cannot upgrade yet, pass a fetch that refuses redirects, for example (url, init) => fetch(url, { ...init, redirect: 'error' }).