Vulnerabilities in pkg:npm/@modelcontextprotocol/server-legacy

PACKAGE
Advisory Identifier: GHSA-rvq5-wwqv-78pq
Advisory Summary

CVE-2026-111771 is a MODERATE (CVSS 6.8) server bearer authentication accepted tokens vulnerability (CWE-863: Incorrect Authorization) affecting MCP TypeScript SDK libraries in the npm ecosystem. The issue involves server bearer authentication accepted tokens issued for another service. Remediation is available by upgrading affected packages to version 1.32.0, 2.3.0, 2.0.2, 2.3.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@modelcontextprotocol/server-legacy

1 Known Advisory Record(s)

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

Advisory ID CVE / NVD Severity Summary
GHSA-rvq5-wwqv-78pq CVE-2026-111771 MODERATE MCP TypeScript SDK: Server bearer authentication accepted tokens issued for another service

CVE-2026-111771 at a Glance

CVE Identifier CVE-2026-111771
GHSA Identifier GHSA-rvq5-wwqv-78pq
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-863: Incorrect Authorization
Affected Product MCP TypeScript SDK
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.8

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

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

How to Fix CVE-2026-111771

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.32.0
npm install @modelcontextprotocol/sdk@1.32.0
@modelcontextprotocol/server fixed: 2.3.0
npm install @modelcontextprotocol/server@2.3.0
@modelcontextprotocol/express fixed: 2.0.2
npm install @modelcontextprotocol/express@2.0.2
@modelcontextprotocol/server-legacy fixed: 2.3.1
npm install @modelcontextprotocol/server-legacy@2.3.1
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-111771, 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.32.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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. 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 server-side bearer authentication had no way to check that a token was issued for your server (its audience). Where one authorization server issues tokens for several services, a valid token for another service was also accepted by your MCP server. ### Am I affected? Yes, if your HTTP server uses `requireBearerAuth()` or `verifyBearerToken()`, its authorization server also issues tokens for other services, and your `verifyAccessToken()` does not check the token's audience (`aud`) itself. Affected versions: - `@modelcontextprotocol/sdk` 1.6.0 through 1.31.0 - `@modelcontextprotocol/server` 2.0.0 through 2.2.0 - `@modelcontextprotocol/express` 2.0.0 through 2.0.1 - `@modelcontextprotocol/server-legacy` 2.0.0 through 2.3.0 ### Fix Upgrade to: - 1.x: `@modelcontextprotocol/sdk` 1.32.0 or later - 2.x: `@modelcontextprotocol/server` 2.3.0 or later, together with `@modelcontextprotocol/express` 2.0.2 or later if you use it - `@modelcontextprotocol/server-legacy` 2.3.1 or later **Upgrading alone changes nothing.** The patched versions add an `expectedResource` setting that is off by default. To turn the check on, make both of these changes together: 1. Pass the audience your authorization server puts in tokens for your server: `requireBearerAuth({ verifier, expectedResource: new URL('https://mcp.example.com/mcp') })`. 2. Return the token's audience from `verifyAccessToken()` as `AuthInfo.resource`, also a `URL`. A token for another service then gets `401`. With only the first change, every request gets `401`. If you cannot upgrade yet, reject any token whose `aud` does not include your server inside `verifyAccessToken()`. That closes the issue on every version.

CVE-2026-111771 Affected MCP TypeScript SDK Versions

4 component(s)
Fixed Versions:
1.32.02.3.02.0.22.3.1
Product / Package Ecosystem Affected Versions Fixed Version
@modelcontextprotocol/sdk
npm
≥ 1.6.0
< 1.32.0
1.32.0
@modelcontextprotocol/server
npm
≥ 2.0.0
< 2.3.0
2.3.0
@modelcontextprotocol/express
npm
≥ 2.0.0
< 2.0.2
2.0.2
@modelcontextprotocol/server-legacy
npm
≥ 2.0.0
< 2.3.1
2.3.1

References

Frequently Asked Questions

What is CVE-2026-111771?
CVE-2026-111771 is a security vulnerability in MCP TypeScript SDK involving Server bearer authentication accepted tokens issued for another service under CWE-863: Incorrect Authorization.
Which MCP TypeScript SDK versions are affected?
Affected versions include releases prior to 1.32.0, 2.3.0, 2.0.2, 2.3.1 across affected packages: @modelcontextprotocol/sdk, @modelcontextprotocol/server, @modelcontextprotocol/express, @modelcontextprotocol/server-legacy.
What version fixes CVE-2026-111771?
Upgrading to 1.32.0, 2.3.0, 2.0.2, 2.3.1 (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.32.0. Upgrade your dependency to 1.32.0 or later.
Is @modelcontextprotocol/server affected?
Yes, @modelcontextprotocol/server is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2026-111771?
CVE-2026-111771 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2026-111771?
CVE-2026-111771 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check npm dependencies for CVE-2026-111771?
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-rvq5-wwqv-78pq",
  "modified" : "2026-10-20T19:43:37Z",
  "published" : "2026-10-20T19:43:36Z",
  "aliases" : [ "CVE-2026-111771" ],
  "summary" : "MCP TypeScript SDK: Server bearer authentication accepted tokens issued for another service",
  "details" : "### Summary\nIn affected versions, the SDK's server-side bearer authentication had no way to check that a token was issued for your server (its audience). Where one authorization server issues tokens for several services, a valid token for another service was also accepted by your MCP server.\n\n### Am I affected?\nYes, if your HTTP server uses `requireBearerAuth()` or `verifyBearerToken()`, its authorization server also issues tokens for other services, and your `verifyAccessToken()` does not check the token's audience (`aud`) itself.\n\nAffected versions:\n\n- `@modelcontextprotocol/sdk` 1.6.0 through 1.31.0\n- `@modelcontextprotocol/server` 2.0.0 through 2.2.0\n- `@modelcontextprotocol/express` 2.0.0 through 2.0.1\n- `@modelcontextprotocol/server-legacy` 2.0.0 through 2.3.0\n\n### Fix\nUpgrade to:\n\n- 1.x: `@modelcontextprotocol/sdk` 1.32.0 or later\n- 2.x: `@modelcontextprotocol/server` 2.3.0 or later, together with `@modelcontextprotocol/express` 2.0.2 or later if you use it\n- `@modelcontextprotocol/server-legacy` 2.3.1 or later\n\n**Upgrading alone changes nothing.** The patched versions add an `expectedResource` setting that is off by default. To turn the check on, make both of these changes together:\n\n1. Pass the audience your authorization server puts in tokens for your server: `requireBearerAuth({ verifier, expectedResource: new URL('https://mcp.example.com/mcp') })`.\n2. Return the token's audience from `verifyAccessToken()` as `AuthInfo.resource`, also a `URL`.\n\nA token for another service then gets `401`. With only the first change, every request gets `401`.\n\nIf you cannot upgrade yet, reject any token whose `aud` does not include your server inside `verifyAccessToken()`. That closes the issue on every version.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/sdk"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.6.0"
      }, {
        "fixed" : "1.32.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/express"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.0.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@modelcontextprotocol/server-legacy"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0"
      }, {
        "fixed" : "2.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/security/advisories/GHSA-rvq5-wwqv-78pq"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/commit/40f8f4e229d963cd7fd2890bda2aeebe7005299a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/commit/5a0724d14cf34a27a3b070224d2996cdd611df9f"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk/commit/5a1867390b91b8836f49af76c45427279f513325"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/modelcontextprotocol/typescript-sdk"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-20T19:43:36Z",
    "nvd_published_at" : null
  }
}