Skip to main content

CVE-2026-64684 — Vulnerability in rmcp — CVE Details

MEDIUM

RMCP: Custom HTTP headers leak to cross-origin redirect targets

Published September 17, 2026Updated September 17, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (0.50%). Schedule for your next planned update.

Does your project use an affected rmcp version?

Paste your Cargo.lock to check it for CVE-2026-64684 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.

Check my Cargo.lock

Summary

Summary

The rmcp crate's StreamableHttpClientTransport forwards caller-supplied custom HTTP headers (such as X-API-Key, X-Auth-Token, Api-Key) to cross-origin redirect targets. The default_http_client() function builds a reqwest::Client without a redirect policy override, so the default limited(10) policy follows 307/308 redirects and forwards all per-request headers except Authorization, Cookie, and Proxy-Authorization. Custom auth headers injected via StreamableHttpClientTransportConfig.custom_headers are not classified as sensitive and are therefore forwarded verbatim to any redirect target — including an attacker-controlled server.

Affected versions

  • Repository: github.com/modelcontextprotocol/rust-sdk
  • Crate: rmcp
  • Commit tested: c330fede90e4729c234f8e87fdbc5ea27a1dd10c (HEAD, 2026-05-21)

Vulnerability

File: crates/rmcp/src/transport/common/reqwest/streamable_http_client.rs

Root cause 1 — no redirect policy override:

// Lines 302-307
fn default_http_client() -> reqwest::Client {
    reqwest::Client::builder()
        .pool_max_idle_per_host(0)
        .build()
        .expect("failed to build default reqwest client")
}

No .redirect(reqwest::redirect::Policy::none()) call. The default limited(10) policy follows up to 10 redirects and, on cross-origin redirects, strips only Authorization, Cookie, and Proxy-Authorization.

Root cause 2 — custom headers not sensitivity-marked:

// Lines 26-35
fn apply_custom_headers(
    mut builder: reqwest::RequestBuilder,
    custom_headers: HashMap<HeaderName, HeaderValue>,
) -> Result<reqwest::RequestBuilder, StreamableHttpError<reqwest::Error>> {
    for (name, value) in custom_headers {
        validate_custom_header(&name).map_err(StreamableHttpError::ReservedHeaderConflict)?;
        builder = builder.header(name, value);  // no sensitivity marker
    }
    Ok(builder)
}

Headers added via RequestBuilder::header() are forwarded to redirect targets because reqwest only strips headers from its own sensitive-header list (Authorization, Cookie, Proxy-Authorization).

Exposed API: StreamableHttpClientTransportConfig.custom_headers (line 1070), intended for custom auth headers:

/// Custom HTTP headers to include with every request
pub custom_headers: HashMap<HeaderName, HeaderValue>,

Attack scenario

  1. A caller sets custom_headers with an API key for the MCP server:
    let config = StreamableHttpClientTransportConfig::with_uri("https://mcp.example.com/mcp")
        .custom_headers([(HeaderName::from_static("x-api-key"),
                          HeaderValue::from_static("my-secret-key"))].into());
    
  2. An attacker compromises mcp.example.com to return 307 Temporary Redirect to https://attacker.example.net/capture.
  3. rmcp follows the redirect, forwarding X-API-Key: my-secret-key to attacker.example.net.
  4. The attacker captures the secret and reuses it to call the MCP server directly.

Negative control

The auth_header path (StreamableHttpClientTransportConfig::auth_header()) sets the value via builder.bearer_auth(auth_header), which maps to the Authorization header — stripped by reqwest on cross-origin redirects. That path is not affected. Only custom_headers is vulnerable.

Fix

In default_http_client(), disable automatic redirect following:

fn default_http_client() -> reqwest::Client {
    reqwest::Client::builder()
        .pool_max_idle_per_host(0)
        .redirect(reqwest::redirect::Policy::none())  // <-- add this
        .build()
        .expect("failed to build default reqwest client")
}

The transport can then inspect 3xx responses and decide whether to follow, stripping sensitive headers before doing so. Alternatively, use reqwest::ClientBuilder::connection_verbose or per-request Request::headers_mut() to remove auth headers before the redirect is followed.

Advisory Timeline

  • First published September 17, 2026 (70 days ago).
  • Last revised September 17, 2026 — 0 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Cargo
Update rmcp to 2.1.0 or later
cargo update -p rmcp --precise 2.1.0

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: crates.io (1).

PackageFixed In
rmcp crates.io · Affected: All versions2.1.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-200
    Information ExposureMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 6.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:N/A:N

Frequently Asked Questions

What is CVE-2026-64684?
RMCP: Custom HTTP headers leak to cross-origin redirect targets. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 6.8/10).
How do I check if my project is affected by CVE-2026-64684?
CVE-2026-64684 affects rmcp. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-64684 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
6.8

Exploitation requires specific conditions, or the impact is limited.

EPSS Score (30-day exploit probability)
0.50%
EPSS percentile: 35.8

This is a below-median EPSS score — only 35.8% 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

GHSA-9g45-5xwm-f3wc

Related CVEs

  • CVE-2026-42559
    HIGH

    DNS rebinding vulnerability in rmcp Streamable HTTP server transport

  • CVE-2026-63127
    HIGH

    RMCP: Missing Resource Field Validation in OAuth Protected Resource Metadata Discovery

  • CVE-2026-42559
    HIGH

    rmcp Streamable HTTP server transport has a DNS rebinding vulnerability

  • CVE-2026-63128
    HIGH

    RMCP: Unauthenticated permanent session-table leak in rmcp Streamable HTTP server transport leads to remote denial-of-service

  • CVE-2026-115906
    MEDIUM

    zip: AES Entry HMAC Authentication Bypass on Premature EOF

  • CVE-2026-35374
    MEDIUM

    split: TOCTOU output-open allows truncating a swapped file

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my Cargo.lock