Skip to main content

CVE-2026-104850: CWE-345: Insufficient Verification of Data Authenticity in modelcontextprotocol typescript-sdk

0
High
Published: 10/06/2026 (10/06/2026, 16:08:21 UTC)
Source: CVE Database V5
Vendor/Project: modelcontextprotocol
Product: typescript-sdk

Description

### 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_token` and `client_secret` stored from an earlier sign-in - the `client_secret` 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`.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Affected software

modelcontextprotocol

typescript-sdk

Affected versions
>=1.12.0 <1.31.0>=2.0.0 <2.2.0
@modelcontextprotocol/sdk
pkg:npm/@modelcontextprotocol/sdk
Affected versions
=31.0.0
@modelcontextprotocol/client
pkg:npm/@modelcontextprotocol/client
Affected versions
>=2.0.0 <2.2.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 10/06/2026, 16:33:37 UTC

Technical Analysis

The MCP TypeScript SDK's OAuth client implementation prior to versions 1.31.0 and 2.2.0 does not properly bind stored OAuth credentials to their legitimate authorization servers. This allows an MCP server, if malicious or compromised, to specify its own authorization server in protected resource metadata, causing the client to send sensitive OAuth tokens and secrets to an attacker-controlled server without user interaction. Affected applications are those using the SDK as an MCP client over HTTP with certain auth providers and connecting to MCP servers that are not fully trusted. The issue is fixed in @modelcontextprotocol/sdk 1.31.0 and @modelcontextprotocol/client 2.2.0. Versions 2.0.0 and 2.1.0 already support an expectedIssuer parameter to mitigate this risk. For 1.x versions, the only workaround is to connect only to trusted MCP servers.

Potential Impact

An attacker controlling or compromising an MCP server can cause clients to send OAuth refresh tokens and client secrets to an attacker-controlled authorization server without user interaction. This can lead to unauthorized access to protected resources by misuse of stolen credentials. The vulnerability affects confidentiality but not integrity or availability. The CVSS score of 7.5 reflects a high impact on confidentiality with no required privileges or user interaction.

Mitigation Recommendations

A fix is available in @modelcontextprotocol/sdk version 1.31.0 and @modelcontextprotocol/client version 2.2.0. Users should upgrade to these versions to remediate the vulnerability. For those unable to upgrade, versions 2.0.0 and 2.1.0 support an expectedIssuer parameter that can be used as a workaround. For 1.x versions, the only effective mitigation is to connect OAuth-enabled clients only to MCP servers that are fully trusted. No other vendor advisories indicate additional mitigations.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-10-02T14:38:43.244Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6ac51f772cdf04f656c32840

Added to database: 10/06/2026, 16:19:03 UTC

Last enriched: 10/06/2026, 16:33:37 UTC

Last updated: 10/06/2026, 21:42:15 UTC

Views: 18

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses