CVE-2026-104850: MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
High CVSS 7.5
- OSV id
- GHSA-6qxp-vccf-f47h
- Also known as
- CVE-2026-104850
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| @modelcontextprotocol/sdk npm |
>= 1.12.0, < 1.31.0 | 1.31.0 |
| @modelcontextprotocol/client npm |
>= 2.0.0, < 2.2.0 | 2.2.0 |
Versions we track that it affects: @modelcontextprotocol/sdk 1.30.0;
How to fix it
@modelcontextprotocol/sdk (npm)
Upgrade @modelcontextprotocol/sdk to 1.31.0 or later.
npm install @modelcontextprotocol/sdk@1.31.0
# if it is an indirect dependency: npm update @modelcontextprotocol/sdk (or npm audit fix)
- If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
@modelcontextprotocol/client (npm)
Upgrade @modelcontextprotocol/client to 2.2.0 or later.
npm install @modelcontextprotocol/client@2.2.0
# if it is an indirect dependency: npm update @modelcontextprotocol/client (or npm audit fix)
- If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
Not sure whether your project uses an affected version? Check your lockfile below for free.
Details
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()
- an
- 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
- bundled providers without
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 yourOAuthClientProviderpersisted (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 whatsaveTokens()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.
References
- GHSA-6qxp-vccf-f47h on OSV.dev
- Web: https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-6qxp-vccf-f47h
- Web: https://github.com/modelcontextprotocol/typescript-sdk/pull/2887
- Web: https://github.com/modelcontextprotocol/typescript-sdk/commit/edd12e282620ebf770d67316f19cf91d4112a1bd
- Package: https://github.com/modelcontextprotocol/typescript-sdk
- Web: https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v2.2.0
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.