CVE-2026-104850: MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server

Published Oct 6, 2026
·
Updated

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 refreshtoken and clientsecret stored from an earlier sign-in - the clientsecret or 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 authProvider on a transport - the withOAuth() middleware - direct calls to auth() or fetchToken() - it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization server

Affected versions:

- @modelcontextprotocol/sdk 1.12.0 through 1.30.1 - @modelcontextprotocol/client 2.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 OAuthTokensSchema or OAuthClientInformationSchema

Not affected:

- MCP servers built with the SDK - stdio clients

Fix Upgrade to:

- 1.x: @modelcontextprotocol/sdk 1.31.0 or later - 2.x: @modelcontextprotocol/client 2.2.0 or later, and @modelcontextprotocol/core 2.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): pass expectedIssuer, for example expectedIssuer: '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 OAuthClientProvider persisted (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. Add issuer to them, or clear them so users sign in again. - Your own OAuthClientProvider: save exactly what saveTokens() and saveClientInformation() are given, including issuer. For pre-registered credentials, include issuer in what clientInformation() 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() and exchangeAuthorization() 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.

Other sources

MCP TypeScript SDK is the official TypeScript SDK for Model Context Protocol servers and clients. Starting in version 1.12.0 and prior to versions 1.31.0 and 2.2.0, the SDK's OAuth client support let the MCP server a client connected to decide which authorization server received the client's OAuth credentials. Stored and pre-provisioned credentials were not bound to the authorization server they belong to. A malicious or compromised MCP server could name its own authorization server in its protected resource metadata. Without any user interaction, the client would send that server the refreshtoken and clientsecret stored from an earlier sign-in (1.x), or the configured clientsecret or signed assertion of a bundled non-interactive provider (1.x and 2.x). Only those applications that use the SDK as an MCP client over HTTP with an authProvider: your own OAuthClientProvider, or the bundled ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider or (2.x) CrossAppAccessProvider and that may connect to an MCP server the owners does not fully trust while holding credentials for a legitimate authorization server are affected. @modelcontextprotocol/sdk 1.31.0 (1.x) and @modelcontextprotocol/client 2.2.0 (2.x) patch the issue. A workaround for those who cannot upgrade is available. 2.0.0 and 2.1.0 already accept expectedIssuer. On 1.x, the only workaround is to connect OAuth-enabled clients only to MCP servers you trust.

— MITRE

Affected Software

2 affected componentsFixes available
npm/@modelcontextprotocol/client>=2.0.0<2.2.0
2.2.0
npm/@modelcontextprotocol/sdk>=1.12.0<1.31.0
1.31.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/@modelcontextprotocol/client to a version that resolves this vulnerability.

    Fixed in 2.2.0
  2. Upgrade

    Upgrade npm/@modelcontextprotocol/sdk to a version that resolves this vulnerability.

    Fixed in 1.31.0
  3. Upgrade

    Upgrade @modelcontextprotocol/sdk to a version that resolves this vulnerability.

    Fixed in 1.31.0
  4. Upgrade

    Upgrade @modelcontextprotocol/client to a version that resolves this vulnerability.

    Fixed in 2.2.0
  5. Upgrade

    Upgrade @modelcontextprotocol/core to a version that resolves this vulnerability.

    Fixed in 2.2.0
  6. Configuration

    Configure the bundled provider with expectedIssuer set to the legitimate authorization server issuer, such as https://auth.example.com.

    ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider, CrossAppAccessProvider expectedIssuer = https://auth.example.com
  7. Configuration

    Persist issuer exactly as provided to saveTokens() and saveClientInformation(); include issuer in clientInformation() for pre-registered credentials.

    OAuthClientProvider issuer = authorization server issuer
  8. Compensating control

    Until upgrading, connect OAuth-enabled clients only to MCP servers you trust and complete sign-ins only for trusted servers.

  9. Operational

    For credentials saved without issuer, add issuer or clear the stored tokens and client information so users sign in again.

  10. Operational

    If an affected client may have connected to an untrusted MCP server, rotate its client secret or signing key and revoke its tokens.

Event History

Oct 6, 2026
Advisory Published
via GitHub·03:35 PM
Data Sourced
via GitHub·03:35 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·04:08 PM
Data Sourced
via MITRE·04:08 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to credential disclosure?

Applications are affected if they use the SDK OAuth client over HTTP through an authProvider on a transport, the withOAuth() middleware, or direct auth() or fetchToken() calls, and may connect to an MCP server they do not fully trust while holding credentials for a legitimate authorization server.

2

What could a malicious MCP server obtain?

It could cause the client to send refresh tokens and client secrets retained from an earlier sign-in. It could also receive a client secret or signed assertion configured on a bundled provider, without user interaction.

3

When is @modelcontextprotocol/client affected?

For versions 2.0.0 through 2.1.0, the listed exposure applies only to bundled providers without expectedIssuer, credentials stored or supplied without issuer, direct fetchToken() calls, or providers that read storage through OAuthTokensSchema or OAuthClientInform…

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203