AAK-MCP-TSSDK-CVE-2026-104850-001: MCP TypeScript SDK 1.12.0 to 1.30.1 (2.x client below 2.2.0): the MCP server picks where OAuth credentials go
- Severity
- HIGH
- Category
- Supply Chain (
supply-chain) - Scanner
agent_audit_kit/scanners/mcp_cve_pins_2026_07.py- Auto-fixable
- No.
- SARIF name
McpTypeScriptSdkOAuthIssuerConfusion
What it detects
The official MCP TypeScript SDK (@modelcontextprotocol/sdk on npm for 1.x, @modelcontextprotocol/client for 2.x) can act as an MCP client over HTTP with OAuth. From 1.12.0, when the client began reading the authorization server from the MCP server's protected resource metadata, until 1.31.0 and 2.2.0, stored and pre-provisioned credentials were not bound to the authorization server they belong to. A malicious or compromised MCP server could name its own authorization server, and with no user interaction the client sent it the refresh_token and client_secret stored from an earlier sign-in (1.x), or the client_secret or signed assertion of a bundled non-interactive provider (1.x and 2.x) (CVE-2026-104850, CVSS 3.1 7.5, CWE-345/CWE-522, GHSA-6qxp-vccf-f47h). Only an application that uses the SDK as an MCP client over HTTP with an authProvider (its own OAuthClientProvider, or the bundled ClientCredentialsProvider, PrivateKeyJwtProvider, StaticPrivateKeyJwtProvider or, on 2.x, CrossAppAccessProvider) and may connect to an MCP server it does not fully trust is exposed. 1.31.0 and 2.2.0 record the authorization server as issuer on saved credentials and do not send them to another one.
How to fix
Upgrade @modelcontextprotocol/sdk to 1.31.0 or later, or on 2.x @modelcontextprotocol/client (and @modelcontextprotocol/core, if you import it directly) to 2.2.0 or later, and pin it. The upgrade alone is not enough: pass expectedIssuer to the bundled providers, add issuer to credentials saved before the upgrade or clear them, and have your own OAuthClientProvider save the issuer it is given. Rotate any credential a client may have sent to an MCP server you do not trust.
To confirm the finding is gone, report only this rule:
agent-audit-kit scan . --rules AAK-MCP-TSSDK-CVE-2026-104850-001
Limitations
Reports @modelcontextprotocol/sdk from 1.12.0 up to 1.31.0 and @modelcontextprotocol/client below 2.2.0 where a package.json, lockfile or MCP config states the version, reporting a range that admits an affected version. latest and other tags state no version and are not reported. It reads the version, not how the SDK is used, so an MCP server built on the SDK, or a client that speaks only stdio, is reported without being exposed. @modelcontextprotocol/core is not read: the advisory names it only as an upgrade for direct importers, and @modelcontextprotocol/client 2.2.0 pins it at 2.2.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
- CVE: CVE-2026-104850
- OWASP MCP Top 10: MCP01:2025 (Token Mismanagement & Secret Exposure), MCP04:2025 (Software Supply Chain Attacks & Dependency Tampering)
- OWASP Agentic Top 10: ASI03 (Identity and Privilege Abuse), ASI04 (Agentic Supply Chain Vulnerabilities)
- Adversa AI MCP Top 25 (AAK-defined ids): ADV-SUPPLY-08 (MCP-Specific Vuln)
- CSA AI Controls Matrix (AICM): IAM-01, IAM-16, STA-08
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-104850-001.md: the page then shows that text, with the registry reference appended under it.