Skip to content

AAK-MCP-REMOTE-CVE-2026-51994-001: mcp-remote 0.1.16–0.1.38 trusts URLs a remote MCP server chooses (SSRF, browser launch)

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

What it detects

mcp-remote, the npm proxy that connects stdio MCP clients to remote MCP servers over OAuth, trusts URLs the remote server chooses. From 0.1.32 through 0.1.38 it fetches the resource_metadata URL a server puts in its WWW-Authenticate header with no scheme, hostname or private-address policy (CVE-2026-51994, CVSS 3.1 9.1, CWE-918), and it fetches /.well-known/oauth-authorization-server from an authorization-server origin taken from server-controlled metadata without validating that origin (CVE-2026-51995, CVSS 3.1 7.5). A malicious or compromised MCP server therefore makes the client request localhost services, private-network addresses or cloud metadata endpoints during OAuth discovery, before any tool is called. From 0.1.16, the release that added a URL check before opening the user's browser, that check accepts any HTTP(S) URL and lets loopback, private, link-local and metadata destinations through to the browser launch (CVE-2026-51997, CVSS 3.1 8.8). In the same 0.1.16–0.1.38 range NVD records CVE-2026-51996 (CVSS 3.1 9.8, CWE-328) as code execution through getServerUrlHash in src/lib/utils.ts, which names each server's OAuth state and token files from an MD5 hash; the advisory NVD cites (F-04) was corrected in its v1.0.1 to call this hardening, with no token takeover shown. From 0.1.18 NVD also records CVE-2026-52001 (CVSS 3.1 7.5 from CISA-ADP, CWE-200) as information disclosure through the SSE transport's eventSourceInit fetch wrapper, which adds the bearer token with no origin check of its own; its advisory (F-11) was likewise corrected in v1.0.1 to defense in depth, because the SDK and undici versions it reviewed keep the token from crossing origins. The range is the union of the advisories': they were reconfirmed against 0.1.38, and upstream has published neither an advisory nor a fix, so this rule makes no claim about 0.1.39 or later in either direction.

How to fix

Move off 0.1.16–0.1.38 and pin the release you move to. Upstream names no fixed version, so check that it validates discovery and authorization URLs before trusting it. Connect mcp-remote only to MCP servers you trust, and where the client host can reach metadata or admin endpoints, put an egress policy in front of it that blocks loopback, link-local and private destinations on every request and redirect.

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

agent-audit-kit scan . --rules AAK-MCP-REMOTE-CVE-2026-51994-001

Limitations

Reports only a reference that states a version in the range: an mcp-remote@0.1.x argument in an MCP config, a package.json dependency or a lockfile entry. An unpinned npx mcp-remote is not reported, because it resolves to the newest release (0.14.x on 2026-09-27), which the advisories did not test. Versions before 0.1.16 carry CVE-2025-6514 (OS command injection through the authorization endpoint URL, fixed in 0.1.16), which this rule does not report. 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-REMOTE-CVE-2026-51994-001.md: the page then shows that text, with the registry reference appended under it.