Vulnerabilities in pkg:npm/@modelcontextprotocol/sdk

PACKAGE
Advisory Identifier: GHSA-6qxp-vccf-f47h
Advisory Summary

CVE-2026-104850 is a HIGH (CVSS 7.5) oauth client could send credentials vulnerability (CWE-522: Insufficiently Protected Credentials) affecting MCP TypeScript SDK libraries in the npm ecosystem. The issue involves oauth client could send credentials to an authorization server chosen by the mcp server. Remediation is available by upgrading affected packages to version 1.31.0, 2.2.0.

4 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@modelcontextprotocol/sdk

4 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@modelcontextprotocol/sdk. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6qxp-vccf-f47h CVE-2026-104850 HIGH MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server
GHSA-8r9q-7v3j-jr4g CVE-2026-0621 HIGH Anthropic's MCP TypeScript SDK has a ReDoS vulnerability
GHSA-345p-7cg4-v4c7 CVE-2026-25536 HIGH @modelcontextprotocol/sdk has cross-client data leak via shared server/transport instance reuse
GHSA-w48q-cv73-mx4w CVE-2025-66414 HIGH Model Context Protocol (MCP) TypeScript SDK does not enable DNS rebinding protection by default

CVE-2026-104850 at a Glance

CVE Identifier CVE-2026-104850
GHSA Identifier GHSA-6qxp-vccf-f47h
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-522: Insufficiently Protected Credentials
Affected Product MCP TypeScript SDK
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).

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

How to Fix CVE-2026-104850

To remediate this vulnerability, upgrade all affected MCP TypeScript SDK dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@modelcontextprotocol/sdk fixed: 1.31.0
npm install @modelcontextprotocol/sdk@1.31.0
@modelcontextprotocol/client fixed: 2.2.0
npm install @modelcontextprotocol/client@2.2.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @modelcontextprotocol/sdk

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-104850, inspect your project dependencies using npm:

npm ls @modelcontextprotocol/sdk

Analyze the terminal output to locate any version of MCP TypeScript SDK in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.31.0), your application is affected.

Note: The npm ls @modelcontextprotocol/sdk command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-522: Insufficiently Protected Credentials, where the product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval. In MCP TypeScript SDK, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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`.

CVE-2026-104850 Affected MCP TypeScript SDK Versions

2 component(s)
Fixed Versions:
1.31.02.2.0
Product / Package Ecosystem Affected Versions Fixed Version
@modelcontextprotocol/sdk
npm
≥ 1.12.0
< 1.31.0
1.31.0
@modelcontextprotocol/client
npm
≥ 2.0.0
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is CVE-2026-104850?
CVE-2026-104850 is a security vulnerability in MCP TypeScript SDK involving OAuth client could send credentials to an authorization server chosen by the MCP server under CWE-522: Insufficiently Protected Credentials.
Which MCP TypeScript SDK versions are affected?
Affected versions include releases prior to 1.31.0, 2.2.0 across affected packages: @modelcontextprotocol/sdk, @modelcontextprotocol/client.
What version fixes CVE-2026-104850?
Upgrading to 1.31.0, 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @modelcontextprotocol/sdk affected?
Yes, @modelcontextprotocol/sdk is affected in releases prior to 1.31.0. Upgrade your dependency to 1.31.0 or later.
Is @modelcontextprotocol/client affected?
Yes, @modelcontextprotocol/client is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of CVE-2026-104850?
CVE-2026-104850 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2026-104850?
CVE-2026-104850 is classified under CWE-522: Insufficiently Protected Credentials (The product transmits or stores authentication credentials, but it uses an insecure method that is susceptible to unauthorized interception and/or retrieval.).
How can I check npm dependencies for CVE-2026-104850?
Run the dependency tree command: 'npm ls @modelcontextprotocol/sdk'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6qxp-vccf-f47h",
  "modified" : "2026-10-06T15:35:44Z",
  "published" : "2026-10-06T15:35:44Z",
  "aliases" : [ "CVE-2026-104850" ],
  "summary" : "MCP TypeScript SDK: OAuth client could send credentials to an authorization server chosen by the MCP server",
  "details" : "### Summary\nIn 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.\n\nA malicious or compromised MCP server could name its own authorization server. With no user interaction, the client would send it:\n\n- the `refresh_token` and `client_secret` stored from an earlier sign-in\n- the `client_secret` or signed assertion configured on a bundled provider\n\n### Am I affected?\nYes, if both of these hold:\n\n- your application uses the SDK's OAuth client over HTTP, through any of:\n    - an `authProvider` on a transport\n    - the `withOAuth()` middleware\n    - direct calls to `auth()` or `fetchToken()`\n- it may connect to an MCP server you do not fully trust while holding credentials for a legitimate authorization server\n\nAffected versions:\n\n- `@modelcontextprotocol/sdk` 1.12.0 through 1.30.1\n- `@modelcontextprotocol/client` 2.0.0 through 2.1.0, only for:\n    - bundled providers without `expectedIssuer`\n    - credentials stored or supplied without `issuer`\n    - direct calls to `fetchToken()`\n    - providers that read storage back through `OAuthTokensSchema` or `OAuthClientInformationSchema`\n\nNot affected:\n\n- MCP servers built with the SDK\n- stdio clients\n\n### Fix\nUpgrade to:\n\n- 1.x: `@modelcontextprotocol/sdk` 1.31.0 or later\n- 2.x: `@modelcontextprotocol/client` 2.2.0 or later, and `@modelcontextprotocol/core` 2.2.0 or later if you import it directly\n\nThe 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.\n\nIn the following cases, upgrading to the patched version is not enough. You also need to make a change:\n\n- **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.\n- **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.\n- **Your own `OAuthClientProvider`:** save exactly what `saveTokens()` and `saveClientInformation()` are given, including `issuer`. For pre-registered credentials, include `issuer` in what `clientInformation()` returns.\n\nNot covered by this fix:\n\n- a new interactive sign-in, which still goes to the authorization server the MCP server names. Only complete sign-ins for servers you trust.\n- `refreshAuthorization()` and `exchangeAuthorization()` called directly\n- 2.x with `skipIssuerMetadataValidation: true`\n\nIf an affected client may have connected to an untrusted MCP server, rotate its client secret or signing key and revoke its tokens.\n\nIf you cannot upgrade yet, connect OAuth clients only to MCP servers you trust. 2.0.0 and 2.1.0 already accept `expectedIssuer`.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.12.0"
      }, {
        "fixed" : "1.31.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/client"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-6qxp-vccf-f47h"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/pull/2887"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/commit/edd12e282620ebf770d67316f19cf91d4112a1bd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/releases/tag/v2.2.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-345", "CWE-522" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-06T15:35:44Z",
    "nvd_published_at" : null
  }
}