Skip to content

AAK-MCP-TSSDK-CVE-2026-111770-001: MCP TypeScript SDK server 2.0.0 to 2.2.0: a shared transport or server delivers one HTTP client's messages to another

Severity
HIGH
Category
Supply Chain (supply-chain)
Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py
Auto-fixable
No.
SARIF name
McpTypeScriptSdkSharedServerCrossClient

What it detects

The official MCP TypeScript SDK's 2.x server package (@modelcontextprotocol/server on npm) matched each response and notification to a connection by its JSON-RPC request id alone. SDK clients number their requests from 0, so ids collide in normal use, and an application that built one stateless HTTP transport, or one McpServer or Server, at startup and shared it among several clients could deliver one client's responses and notifications to another (CVE-2026-111770, CVSS 3.1 7.7, CWE-362, GHSA-jm63-cq47-j5jp). Until 2.3.0 the README examples of the hono, express, fastify and node adapters showed that pattern. 2.3.0 refuses to be shared: a second connect() rejects with ALREADY_CONNECTED, a stateless transport rejects its second request, and createMcpHandler() rejects a factory that returns an instance still serving another request (modelcontextprotocol/typescript-sdk#2918). stdio servers, and a createMcpHandler() factory that builds a new server on every call, are not affected. The advisory names only this package: the 1.x @modelcontextprotocol/sdk refuses a second connect and a reused stateless transport from 1.26.0.

How to fix

Upgrade @modelcontextprotocol/server to 2.3.0 or later and pin it, and change the code that shares an instance, since from 2.3.0 a shared instance fails its requests: pass createMcpHandler() a factory that builds a new McpServer on every call, build a new McpServer and transport inside each request handler, or set sessionIdGenerator and keep one server and one transport per session. The same change fixes an affected version if you cannot upgrade yet.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-TSSDK-CVE-2026-111770-001

Limitations

Reports @modelcontextprotocol/server from 2.0.0 up to 2.3.0 where a package.json, lockfile or MCP config states the version, reporting a range that admits an affected version. latest is fixed and states no version, so it is not reported. It reads the version, not the code, so a server that builds its transport and server per request or per session, or one that speaks only stdio, is reported without being exposed. The 1.x @modelcontextprotocol/sdk is not read: the CVE record also lists the typescript-sdk repository below 1.32.0, but the advisory names only the 2.x server, and the sdk refuses a second connect and a reused stateless transport from 1.26.0 (checked in the npm tarballs at 1.26.0 and 1.31.0). A file over 2 MB, or a lockfile over 32 MiB, is not read. A declaration nested more than 64 levels deep in package.json, a TOML manifest or an MCP config (an MCP server more than 62) is still judged, and reported without a line; a lockfile entry keeps its line at any depth.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-TSSDK-CVE-2026-111770-001.md: the page then shows that text, with the registry reference appended under it.