CVE-2026-63127 — RMCP: Missing Resource Field Validation in rmcp
RMCP: Missing Resource Field Validation in OAuth Protected Resource Metadata Discovery
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.24%). Schedule for your next planned update.
Does your project use an affected rmcp version?
Paste your Cargo.lock to check it for CVE-2026-63127 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
The rmcp library does not validate the resource parameter in OAuth Protected Resource metadata (RFC 9728), allowing a malicious MCP server to redirect OAuth flows to a legitimate authorization server and steal the resulting access tokens.
Details
RFC 9728 specifies two MUST requirements for resource parameter validation:
- Section 7.3: the client MUST ensure that the resource identifier URL it is using as the prefix for the metadata request exactly matches the
resourcevalue in the returned metadata document. - Section 3.3: if the
resourcevalue returned is not identical to the URL the client used, the data MUST NOT be used.
In the current implementation (crates/rmcp/src/transport/auth.rs), the ResourceServerMetadata struct (lines 390–394) does not include a resource field:
struct ResourceServerMetadata {
authorization_server: Option<String>,
authorization_servers: Option<Vec<String>>,
scopes_supported: Option<Vec<String>>,
}
And discover_oauth_server_via_resource_metadata() (lines 1446–1465) proceeds without any resource URL validation.
Recommended fix
- Add the
resourcefield to the struct:struct ResourceServerMetadata { resource: Option<String>, // RFC 9728 REQUIRED field authorization_server: Option<String>, authorization_servers: Option<Vec<String>>, scopes_supported: Option<Vec<String>>, } - Add validation logic after fetching metadata:
let Some(resource_metadata) = self .fetch_resource_metadata_from_url(&resource_metadata_url) .await? else { return Ok(None); }; // RFC 9728: validate that the resource identifier matches our target server if let Some(resource) = &resource_metadata.resource { if resource.trim_end_matches('/') != self.base_url.as_str().trim_end_matches('/') { return Err(AuthError::MetadataError(format!( "Resource metadata mismatch: expected '{}', got '{}'", self.base_url, resource ))); } }
PoC
-
Attacker sets up a malicious MCP server at
fake-mcp.com/mcp. -
At
fake-mcp.com/mcp/.well-known/oauth-protected-resource, the attacker serves metadata declaring:- resource:
real-mcp.com/mcp(the legitimate server) - authorization_servers: the legitimate authorization server(s) of
real-mcp.com/mcp
- resource:
-
Victim configures any MCP client using
rmcpto connect tofake-mcp.com/mcp. -
rmcpfetches the protected resource metadata and, without validating that theresourcefield (real-mcp.com/mcp) differs from the configured server (fake-mcp.com/mcp), initiates an OAuth flow with the legitimate authorization server. -
The victim sees a legitimate authorization prompt and completes the flow.
-
The resulting access token — valid for
real-mcp.com/mcp— is sent tofake-mcp.com/mcpin subsequent requests. -
The attacker captures the token and can impersonate the victim on
real-mcp.com/mcp.
Impact
This is an access token theft vulnerability via OAuth resource metadata spoofing. All MCP clients built on rmcp that rely on OAuth-protected MCP servers are affected. An attacker who tricks a user into connecting to a malicious MCP server can steal valid access tokens for any legitimate MCP server, enabling full impersonation of the victim.
Credit
Jian Cui, Minsun Shim, Zhou Li, Xiaojing Liao University of Illinois Urbana-Champaign (UIUC) University of California, Irvine (UCI)
Advisory Timeline
- First published September 16, 2026 (71 days ago).
- Last revised September 16, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
cargo update -p rmcp --precise 2.0.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: crates.io (1).
| Package | Fixed In |
|---|---|
| rmcp crates.io · Affected: All versions | 2.0.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-345Insufficient Verification of Data AuthenticityMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.2 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N
References
- https://github.com/modelcontextprotocol/rust-sdk/security/advisories/GHSA-33f5-2c5q-wgwjWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-63127ADVISORY
- https://github.com/modelcontextprotocol/rust-sdk/pull/937WEB
- https://github.com/modelcontextprotocol/rust-sdk/commit/c1a8b29ff2cc45e7820b900dae42cbb4958089ecWEB
- https://github.com/modelcontextprotocol/rust-sdkPACKAGE
- https://github.com/modelcontextprotocol/rust-sdk/releases/tag/rmcp-v2.0.0WEB
Frequently Asked Questions
- What is CVE-2026-63127?
- RMCP: Missing Resource Field Validation in OAuth Protected Resource Metadata Discovery. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.2/10).
- How do I check if my project is affected by CVE-2026-63127?
- CVE-2026-63127 affects rmcp. It has a 0.2% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-63127 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 9.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-42559HIGH
DNS rebinding vulnerability in rmcp Streamable HTTP server transport
- CVE-2026-83816HIGH
CodeWhale: exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags enabling silent RCE
- CVE-2026-42559HIGH
rmcp Streamable HTTP server transport has a DNS rebinding vulnerability
- CVE-2026-83817HIGH
CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution
- CVE-2026-63128HIGH
RMCP: Unauthenticated permanent session-table leak in rmcp Streamable HTTP server transport leads to remote denial-of-service
- CVE-2026-64684MEDIUM
RMCP: Custom HTTP headers leak to cross-origin redirect targets