CVE-2026-104850: MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
The MCP TypeScript SDK's OAuth client let an MCP server choose which authorization server received the client's stored credentials. A malicious or compromised server could collect a refresh_token and client_secret with no user interaction. Upgrade @modelcontextprotocol/sdk to 1.31.0 or @modelcontextprotocol/client to 2.2.0, then apply the extra steps below, because upgrading alone is not always enough.
Published Oct 6, 2026 · Analysis Oct 30, 2026
What an attacker can do
The OAuth client did not tie saved credentials to the authorization server that issued them. When it connected to an MCP server, it used whichever authorization server that MCP server named in its metadata. A hostile server could name its own and receive the refresh_token and client_secret from an earlier sign-in. It could also receive the client_secret or signed assertion configured on a bundled provider. No click or approval is needed.
The risk applies to applications that hold credentials for a legitimate authorization server and may also connect to an MCP server they do not fully trust. That describes many agent hosts and IDE clients that let users add remote MCP servers. The attacker gets credentials that can mint access tokens for the real service. The CVSS vector shows high confidentiality impact only.
MCP servers built with the SDK and stdio clients are not affected.
Who is affected
Affected: @modelcontextprotocol/sdk 1.12.0 through 1.30.1. @modelcontextprotocol/client 2.0.0 through 2.1.0 is affected only for bundled providers without expectedIssuer, credentials stored or supplied without issuer, direct fetchToken() calls, and providers that read storage back through OAuthTokensSchema or OAuthClientInformationSchema.
You are exposed if your app uses the OAuth client over HTTP, through an authProvider on a transport, the withOAuth() middleware, or direct calls to auth() or fetchToken().
npm ls @modelcontextprotocol/sdk @modelcontextprotocol/client @modelcontextprotocol/core@modelcontextprotocol/sdk
- Ecosystem
- npm
- Affected
- >= 1.12.0, < 1.31.0
- Fixed in
- 1.31.0
- Check
npm ls @modelcontextprotocol/sdk
@modelcontextprotocol/client
- Ecosystem
- npm
- Affected
- >= 2.0.0, < 2.2.0
- Fixed in
- 2.2.0
- Check
npm ls @modelcontextprotocol/client
How to fix it
Upgrade to @modelcontextprotocol/sdk 1.31.0 or later, or to @modelcontextprotocol/client 2.2.0 or later (plus @modelcontextprotocol/core 2.2.0 if you import it directly):
npm install @modelcontextprotocol/[email protected]The client now saves the authorization server as issuer on credentials and refuses to send them to a different one. Three cases need more than the upgrade:
- Bundled providers (
ClientCredentialsProvider,PrivateKeyJwtProvider,StaticPrivateKeyJwtProvider,CrossAppAccessProvider): passexpectedIssuer. - Credentials saved before the upgrade have no
issuer. Add it or clear them so users sign in again. - Custom
OAuthClientProvider: persist exactly whatsaveTokens()andsaveClientInformation()receive, includingissuer.
Not covered: new interactive sign-ins, direct refreshAuthorization() and exchangeAuthorization() calls, and 2.x with skipIssuerMetadataValidation: true. If a client may have reached an untrusted MCP server, rotate its client secret or signing key and revoke its tokens. Without an upgrade, connect only to trusted servers.
How to tell if you were hit
The advisory lists no log indicators. Review which MCP servers your OAuth clients have connected to and look for any you do not trust. Check your authorization server logs for token or refresh requests that came from unfamiliar networks, and for a client_secret in use from a place your client never runs. Inspect stored token files, keychain entries or database rows for entries missing issuer. Where an AI agent connects to MCP servers, Beam's record of the agent's MCP tool calls shows which servers it used.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
In affected versions, the SDK's OAuth client let the MCP server decide which authorization server received the client's OAuth credentials. Credentials were not tied to the authorization server they belong to.
A malicious or compromised MCP server could name its own authorization server. With no user interaction, the client would send it:
- the
refresh_tokenandclient_secretstored from an earlier sign-in - the
client_secretor signed assertion configured on a bundled provider
Am I affected?
Yes, if both of these hold:
- your application uses the SDK's OAuth client over HTTP, through any of:
- an
authProvideron a transport - the
withOAuth()middleware - direct calls to
auth()orfetchToken() - it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization server
Affected versions:
@modelcontextprotocol/sdk1.12.0 through 1.30.1@modelcontextprotocol/client2.0.0 through 2.1.0, only for:- bundled providers without
expectedIssuer - credentials stored or supplied without
issuer - direct calls to
fetchToken() - providers that read storage back through
OAuthTokensSchemaorOAuthClientInformationSchema
Not affected:
- MCP servers built with the SDK
- stdio clients
Fix
Upgrade to:
- 1.x:
@modelcontextprotocol/sdk1.31.0 or later - 2.x:
@modelcontextprotocol/client2.2.0 or later, and@modelcontextprotocol/core2.2.0 or later if you import it directly
The client now records the authorization server as issuer on saved credentials and does not send them to a different one. The user signs in again, or the call throws.
In the following cases, upgrading to the patched version is not enough. You also need to make a change:
- Bundled providers (
ClientCredentialsProvider,PrivateKeyJwtProvider,StaticPrivateKeyJwtProvider,CrossAppAccessProvider): passexpectedIssuer, for exampleexpectedIssuer: 'https://auth.example.com'. Without it they still use whichever authorization server the MCP server names. - Credentials saved without `issuer`: tokens and client information your
OAuthClientProviderpersisted (file, keychain, database) before upgrading, including everything 1.x saved before 1.31.0. They still go to whichever authorization server is named at first use. Addissuerto them, or clear them so users sign in again. - Your own `OAuthClientProvider`: save exactly what
saveTokens()andsaveClientInformation()are given, includingissuer. For pre-registered credentials, includeissuerin whatclientInformation()returns.
Not covered by this fix:
- a new interactive sign-in, which still goes to the authorization server the MCP server names. Only complete sign-ins for servers you trust.
refreshAuthorization()andexchangeAuthorization()called directly- 2.x with
skipIssuerMetadataValidation: true
If an affected client may have connected to an untrusted MCP server, rotate its client secret or signing key and revoke its tokens.
If you cannot upgrade yet, connect OAuth clients only to MCP servers you trust. 2.0.0 and 2.1.0 already accept expectedIssuer.
Credited to Aviral2642, AlexMelanFromRingo, Gal3m, JosephDoUrden, Igfray, OriginalKazdov, lwebmedia.
Questions
- Is upgrading to 1.31.0 or 2.2.0 enough?
Not always. Bundled providers need
expectedIssuer, and credentials saved before the upgrade need anissueradded or must be cleared. Custom providers must persistissuer.- Does a stdio MCP client have this problem?
No. The advisory says stdio clients and MCP servers built with the SDK are not affected. The flaw is in the HTTP OAuth client.
- Do I need to rotate secrets?
Yes, if the client may have connected to an untrusted MCP server. Rotate the client secret or signing key and revoke the tokens, since a hostile server could already have received them.
References
Read for this analysis:
- https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-6qxp-vccf-f47h
- https://github.com/modelcontextprotocol/typescript-sdk/pull/2887
- https://github.com/modelcontextprotocol/typescript-sdk/commit/edd12e282620ebf770d67316f19cf91d4112a1bd
- https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v2.2.0
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
Coverage on the Beam blog
- Coral MCP Gateway: When Coding Agents Write, Save, and Reuse Their Own Tools
- GitGuardian Enterprise Good Samaritan: When Agents Leave Secrets, Who Gets the Page?
- MCP uvx Supply Chain: Corelight Finds PyPI Drift Behind Pinned MCP Servers
- kaniko CVE-2026-105769: A Lookalike FROM Line Leaks Your Azure Token
- GitBook Says AI Agents Attacked It: Rotate API Tokens, Git Sync Secrets and Re-Authenticate the MCP Server
More MCP TypeScript SDK vulnerabilities
All MCP TypeScript SDK entriesGHSA-f897-62hf-6gxq
MCP TypeScript SDK: HTTP server transports and handlers did not limit request body size or JSON-RPC batch length
high7.5Oct 27, 2026CVE-2026-111767
MCP TypeScript SDK: Experimental tasks were not tied to the session that created them
high8.6Oct 20, 2026CVE-2026-111768
MCP TypeScript SDK: One HTTP request within the default size limit could exhaust server memory during validation
high7.5Oct 20, 2026CVE-2026-111769
MCP TypeScript client SDK: HTTP client transports and OAuth requests followed cross-origin redirects and re-sent custom headers and request bodies
medium6.5Oct 20, 2026CVE-2026-111771
MCP TypeScript SDK: Server bearer authentication accepted tokens issued for another service
medium6.8Oct 20, 2026CVE-2026-25536
@modelcontextprotocol/sdk has cross-client data leak via shared server/transport instance reuse
high7.1Feb 4, 2026
