CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-63127

CVE-2026-63127: OAuth Resource Spoofing and Token Leakage in rmcp SDK

Alon Barad
Alon Barad
Software Engineer

Sep 17, 2026·7 min read·16 visits

Executive Summary (TL;DR)

A missing validation of the RFC 9728 'resource' field in the rmcp crate allows rogue MCP servers to perform OAuth resource spoofing and capture legitimate access tokens.

An OAuth resource spoofing vulnerability in the rmcp crate prior to 2.0.0 allows a malicious Model Context Protocol (MCP) server to spoof protected resource metadata. By presenting metadata pointing to a legitimate resource and authorization server, the attacker can trick the client into completing the authentication flow and subsequently sending the authorized token back to the malicious server.

Vulnerability Overview

The rmcp crate is the official Rust Software Development Kit (SDK) implementing the Model Context Protocol (MCP). The framework operates as a standardized integration layer enabling Large Language Models (LLMs) to communicate with external data sources, applications, and custom tools. In highly secure environments, these transport connections are governed by robust authentication protocols, typically utilizing OAuth 2.0 frameworks. Specifically, the library implements OAuth Protected Resource Metadata discovery as defined under RFC 9728, which outlines the procedure for clients to automatically discover and trust authorization servers that correspond to given resource endpoints.

A high-severity vulnerability designated as CVE-2026-63127 exists in the client's transport authentication implementation, specifically within crates/rmcp/src/transport/auth.rs. Prior to version 2.0.0, the rmcp library did not validate that the resource identifiers returned during the automated discovery flow matched the target server with which the client established the original connection. This design flaw introduces an unauthenticated remote resource spoofing attack vector that compromises the security guarantees of the OAuth handshake.

This weakness is categorized under CWE-345 (Insufficient Verification of Data Authenticity), representing a failure to validate the binding between the metadata issuer and the actual resource identity. If an attacker hosts or compromises an MCP server, they can trick a connecting client into initiating an authentication flow with a legitimate, trusted third-party authorization server. Upon completion of this flow, the client mistakenly transmits the acquired high-privilege access token directly to the attacker's server, enabling downstream impersonation.

Root Cause Analysis

The technical breakdown of the vulnerability centers on the deserialization and subsequent validation logic in the discover_oauth_server_via_resource_metadata routine. According to RFC 9728 Sections 3.3 and 7.3, when a client performs metadata discovery, the resource server must return a JSON payload detailing its capabilities. Critically, the client is required to assert that the resource field inside the metadata response exactly matches the requested resource URL. This mechanism is critical to prevent resource server impersonation.

In affected versions of the rmcp crate, the JSON deserialization model ResourceServerMetadata did not contain the resource field. The library discarded this key entirely during deserialization because the struct was mapped using serde macro traits without a corresponding field placeholder. Consequently, the application logic was blind to the resource claim returned by the server, rendering it incapable of performing any validation checks.

Because the library completely ignored this property, the client did not perform the essential matching of domains, ports, or paths. If a user connected their client to an untrusted or malicious server, the server could instruct the client to authenticate against an arbitrary, highly-trusted authorization server. The validation layer failed to check the legitimacy of this binding, allowing the client to execute the entire OAuth PKCE workflow against the real authorization server under the false context of the untrusted connection.

Code Analysis

To understand the precise code-level flaw, we must analyze the structure of the deserialization schema in crates/rmcp/src/transport/auth.rs prior to the patch.

// Vulnerable Struct Definition
#[derive(Debug, Clone, Deserialize)]
struct ResourceServerMetadata {
    // Note the complete absence of the "resource" field
    authorization_server: Option<String>,
    authorization_servers: Option<Vec<String>>,
    scopes_supported: Option<Vec<String>>,
}

The absence of the resource field meant any server-side value assigned to it was dropped during the deserialization cycle. To fix this, the patch introduces the resource field and implements a strict check in AuthorizationManager::discover_metadata.

// Patched Struct Definition
#[derive(Debug, Clone, Deserialize)]
struct ResourceServerMetadata {
    resource: Option<String>,
    authorization_server: Option<String>,
    authorization_servers: Option<Vec<String>>,
    scopes_supported: Option<Vec<String>>,
}

The validation helper function validate_resource_metadata_resource checks whether the target is valid:

impl AuthorizationManager {
    fn validate_resource_metadata_resource(
        &self,
        metadata: &ResourceServerMetadata,
    ) -> Result<(), AuthError> {
        let Some(resource) = metadata.resource.as_deref() else {
            return Err(AuthError::MetadataError(
                "Protected resource metadata missing required resource field".to_string(),
            ));
        };
 
        if !Self::resource_identifiers_match(self.base_url.as_str(), resource) {
            return Err(AuthError::MetadataError(format!(
                "Protected resource metadata resource mismatch: expected '{}', got '{}'",
                self.base_url, resource
            )));
        }
 
        Ok(())
    }
}

Furthermore, the matching logic utilizes resource_identifiers_match and is_root_resource_identifier to verify root path uniformity. It allows discrepancies limited strictly to root-level trailing slashes, thereby protecting against basic formatting differences while rejecting path traversal or cross-domain deviations.

Exploitation Methodology

Exploiting CVE-2026-63127 relies on standard HTTP manipulation techniques without requiring any advanced host penetration. First, the attacker registers or compromises a public or accessible endpoint, acting as a malicious Model Context Protocol server located at https://attacker-mcp.io. The attacker then waits for a victim client—such as an LLM agent framework configured with the rmcp crate and OAuth features enabled—to initiate a connection.

When the victim connects to the attacker-controlled server, the server responds with an HTTP 401 Unauthorized status code accompanied by a customized challenge header: WWW-Authenticate: Bearer resource_metadata="https://attacker-mcp.io/.well-known/oauth-protected-resource". This header directs the vulnerable client to perform metadata discovery at the specified path.

When the client retrieves the metadata, the attacker's server serves a crafted JSON response:

{
  "resource": "https://trusted-mcp.com",
  "authorization_servers": ["https://auth.trusted-mcp.com"]
}

The client deserializes this metadata, parses the legitimate authorization server list, and starts the login handshake. The victim's browser is launched to complete the authentication against https://auth.trusted-mcp.com.

After the victim successfully signs in and authorizes the application, the client completes the authorization code exchange to fetch an access token. Because the underlying connection state is still bound to https://attacker-mcp.io, the client transmits the legitimate bearer token to the attacker's endpoint. The attacker intercepts this token and can immediately perform authenticated operations on the target https://trusted-mcp.com server within the permissions granted by the stolen scopes.

Impact Assessment

The impact of this resource spoofing flaw is substantial, representing a complete bypass of the security boundary separating distinct OAuth resource domains. Since the vulnerability allows the direct capture of active OAuth bearer tokens, the attacker gains full read, write, or administrative access to the victim's target resource server, restricted only by the scopes assigned to the intercepted token.

In the context of CVSS 3.1, this vulnerability results in a Scope Change (S:C). This is because the compromise of the client's connection to the malicious server directly translates into unauthorized access to a distinct security authority (the trusted resource server). The confidentiality impact is High (C:H), and the integrity impact is Low (I:L) depending on the permissions of the scope requested by the target OAuth server.

No availability impact (A:N) is directly linked to this token theft. The base score is assessed at 8.2 (High). Since the attack requires the victim to click through a standard authentication prompt, user interaction is marked as Required (UI:R), but the complexity of execution remains Low (AC:L), and no initial privileges are required (PR:N) to initiate the spoofing sequence.

Remediation & Defensive Measures

To mitigate the risk of CVE-2026-63127, administrators and developers must upgrade the rmcp dependency to version 2.0.0 or higher. This update alters the deserialization engine to strictly enforce RFC 9728 validation standards, dropping connections where there is a mismatch between the metadata resource field and the connection base URL. Developers should adjust their Cargo.toml file to require version 2.0.0 or later and ensure that lockfiles are fully regenerated.

For environments where immediate library upgrading is impossible, temporary mitigation strategies must be applied. Network administrators can implement Web Application Firewall (WAF) rules or egress filters to block outgoing HTTP requests from client instances to unauthorized or unverified OAuth authorization and metadata endpoints. Additionally, client integrations should disable dynamic metadata discovery and enforce hardcoded, pre-approved lists of authorization servers for each active connection.

In addition to updating dependencies, software developers should treat this vulnerability as a lesson in input validation. Any security framework that delegates authentication parameters to a third party must verify the provenance and identity claims of that third party. Regression test suites should incorporate test assertions that deliberately introduce invalid or mismatched resource metadata to verify that the handshake fails gracefully under incorrect parameters.

Official Patches

modelcontextprotocolPull request incorporating the RFC 9728 resource verification fix

Fix Analysis (1)

Technical Appendix

CVSS Score
8.2/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:L/A:N

Affected Systems

Model Context Protocol (MCP) clients using the rmcp crate with OAuth features enabled

Affected Versions Detail

Product
Affected Versions
Fixed Version
rmcp
modelcontextprotocol
< 2.0.02.0.0
AttributeDetail
CWE IDCWE-345
Attack VectorNetwork (AV:N)
CVSS v3.1 Score8.2 (High)
EPSS ScoreN/A
ImpactConfidentiality High (C:H), Integrity Low (I:L), Scope Changed (S:C)
Exploit StatusProof-of-Concept (PoC) available in official test suite
CISA KEV StatusNot Listed

MITRE ATT&CK Mapping

T1539Steal Web Session Cookie / Token
Credential Access
T1556Modify Authentication Process
Credential Access / Lateral Movement
CWE-345
Insufficient Verification of Data Authenticity

The software does not sufficiently verify the authenticity of data, which can lead to accepting forged or manipulated information.

Known Exploits & Detection

GitHub Test SuiteA comprehensive set of regression tests asserting correct rejection of mismatched resources and missing resource fields in RFC 9728 discovery.

Vulnerability Timeline

Fix commit published and PR #937 merged
2026-06-27
Release rmcp-v2.0.0 published
2026-06-27

References & Sources

  • [1]GHSA-33f5-2c5q-wgwj: OAuth Resource Spoofing Vulnerability in rmcp Crate
  • [2]Pull Request #937
  • [3]Fix Commit
  • [4]Release rmcp-v2.0.0
  • [5]CVE-2026-63127 NVD Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 15 hours ago•CVE-2026-118777
4.8

CVE-2026-118777: Prototype Pollution in Forge HTTP Client Cookie Management

CVE-2026-118777 is a prototype pollution vulnerability (CWE-1321) in the Forge JavaScript cryptography and networking library (distributed on npm as node-forge) prior to version 1.4.1. The flaw resides in the forge.http client subsystem, where incoming HTTP cookie names and paths parsed from Set-Cookie response headers are stored directly into standard JavaScript objects without key validation or property isolation. By returning crafted Set-Cookie headers containing keys such as __proto__ or constructor, a malicious HTTP server can inject arbitrary properties into Object.prototype, attach attributes to the global Object constructor, or delete built-in prototype methods to cause an application-wide denial of service.

Amit Schendel
Amit Schendel
6 views•10 min read
•about 16 hours ago•CVE-2026-118775
3.7

CVE-2026-118775: ASN.1 OID First Arc Truncation and Ambiguity in node-forge

CVE-2026-118775 (GHSA-4642-5mcj-2rqw) is an integer overflow and validation flaw in the ASN.1 serialization module of Forge (node-forge) prior to version 1.4.1. The asn1.oidToDer() function fails to validate the range of the first two arcs of an Object Identifier (OID) and truncates the packed initial subidentifier to a single 8-bit integer. Applications that perform policy checks on untrusted OID strings before encoding them into Distinguished Encoding Rules (DER) format can be tricked into emitting DER bytes that correspond to a completely different, restricted OID.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 17 hours ago•CVE-2026-119194
7.5

CVE-2026-119194: Algorithmic Complexity Denial of Service in pyasn1 Schemaless ASN.1 Decoder

CVE-2026-119194 is an algorithmic complexity vulnerability (CWE-407) in the pyasn1 library for Python, affecting versions 0.3.3 through 0.6.4. The flaw resides in the schemaless decoding routine ConstructedPayloadDecoderBase._decodeComponentsSchemaless used across BER, CER, and DER codecs. By sending an ASN.1 container populated with child components whose tag identifiers are separated by multiples of CPython's integer hash modulus (sys.hash_info.modulus), an unauthenticated attacker can force worst-case hash collisions in an unbounded Python set, degrading decoding performance from O(N) to O(N^2) and causing a Denial of Service (DoS).

Alon Barad
Alon Barad
7 views•9 min read
•about 18 hours ago•CVE-2026-119195
7.5

CVE-2026-119195: Quadratic-Time Denial of Service in pyasn1 BER/CER/DER Decoders

CVE-2026-119195 is an algorithmic complexity vulnerability (CWE-407) in the pyasn1 library for Python, affecting all versions prior to 0.6.5. When decoding constructed strings or indefinite-length ANY types across BER, CER, and certain DER code paths, the payload decoders repeatedly concatenate incoming fragments onto an immutable bytes object using the += operator. Because Python bytes objects cannot be resized in-place, each fragment iteration allocates a new buffer and copies all previously accumulated bytes, resulting in quadratic O(N^2) time and memory copy complexity. An unauthenticated remote attacker can supply a highly fragmented ASN.1 stream to exhaust CPU cycles and stall application worker threads.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 19 hours ago•CVE-2026-119197
7.5

CVE-2026-119197: Quadratic Algorithmic Complexity Denial of Service in pyasn1 REAL Mantissa Decoder

An algorithmic complexity vulnerability (CWE-407) in pyasn1 versions prior to 0.6.5 allows unauthenticated attackers to cause a Denial of Service (DoS) via crafted ASN.1 payloads. The flaw resides in the binary-encoded ASN.1 REAL mantissa deserialization routine within RealPayloadDecoder.valueDecoder. By performing iterative byte-string slicing and repeated bitwise shifts on a growing arbitrary-precision integer, the decoder exhibits quadratic time and memory allocation complexity relative to the mantissa length. Supplying a BER-, CER-, or DER-encoded payload with a large REAL mantissa causes excessive CPU consumption and blocks application worker processes.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 20 hours ago•CVE-2026-119196
7.5

CVE-2026-119196: Quadratic CPU Consumption in pyasn1 Constructed BIT STRING Decoding

A vulnerability classified under CWE-407 (Inefficient Algorithmic Complexity) exists in the pyasn1 library prior to version 0.6.5. When parsing constructed ASN.1 BIT STRING payloads under BER, CER, or schema-driven DER encoding rules, the BitStringPayloadDecoder repeatedly shifts and copies the entire accumulated bit value for each incoming fragment. Processing inputs with a large number of small constructed fragments induces quadratic CPU consumption, allowing unauthenticated remote attackers to cause a denial of service via resource exhaustion during the initial decoding phase.

Alon Barad
Alon Barad
8 views•10 min read