INCIDENT MAP

Browse / MCP and Tool Server Flaws / GHSA-c9xm-49cp-xcr9

rmcp OAuth client fetches server-controlled resource_metadata URLs

GHSA-c9xm-49cp-xcr9 ยท 2026-10-02 moderate

Class
MCP and Tool Server Flaws (filed by a model that read the advisory)
Technique
Server-side request forgery
Affected
rmcp (crates.io)
CVSS
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

How it works, in short

An MCP OAuth client fetches a resource metadata URL taken from a server's WWW-Authenticate header without checking whether it points to internal addresses. (Our summary, written by a model. The source text is below.)

Details

Summary

The rmcp OAuth client accepts a server-controlled resource_metadata= URL from the WWW-Authenticate header and fetches it without same-origin or private-network validation.

An attacker-controlled MCP server can return a 401 WWW-Authenticate: Bearer resource_metadata="..." header pointing at an internal URL, including localhost, RFC 1918 addresses, or cloud metadata endpoints. The client then performs an outbound GET to that URL from the victim application's network context.

Affected version

Source evidence

extract_www_authenticate_params() accepts an absolute URL from the server-controlled header:

let resource_key = "resource_metadata=";
while let Some(pos) = header_lowercase[search_offset..].find(resource_key) {
    let global_pos = search_offset + pos + resource_key.len();
    let value_slice = &header[global_pos..];
    if let Some((value, consumed)) = Self::parse_next_header_value(value_slice) {
        if let Ok(url) = Url::parse(&value) {
            params.resource_metadata_url = Some(url);
            break;
        }
        if let Ok(url) = base_url.join(&value) {
            params.resource_metadata_url = Some(url);
            break;
        }

There is no check that the parsed URL shares origin with the original MCP server, and no block for loopback, link-local, RFC 1918, or metadata hostnames.

fetch_resource_metadata_from_url() then performs the GET:

let response = match self
    .http_client
    .get(resource_metadata_url.clone())
    .header(HEADER_MCP_PROTOCOL_VERSION, "2024-11-05")
    .send()
    .await

Again, there is no same-origin, scheme, host, DNS, or IP-range validation before the request.

Attack scenario

WWW-Authenticate: Bearer resource_metadata="http://169.254.169.254/latest/meta-data/"

This can be used to probe internal services. In environments where the target endpoint returns JSON matching the expected metadata shape, the flow can also chain into additional authorization-server metadata fetches.

Impact

The direct impact is SSRF from any application embedding the rmcp OAuth client. Depending on where the client runs, this can reach:

The attacker controls the URL through the MCP server response. The victim only needs to connect to the attacker's MCP server or a compromised server that can emit the crafted WWW-Authenticate header.

Public duplicate check

On 2026-05-27:

This report is distinct from the redirect-header advisory and the DNS-rebinding advisory.

Suggested fix

Before accepting or fetching a resource_metadata URL:

A minimal same-origin check would compare scheme, host, and effective port:

fn is_same_origin(base: &Url, candidate: &Url) -> bool {
    base.scheme() == candidate.scheme()
        && base.host() == candidate.host()
        && base.port_or_known_default() == candidate.port_or_known_default()
}

If cross-origin resource_metadata is required for compatibility, it should be explicitly opted into and protected by private-network blocking.

References

Source: GitHub Advisory Database, used under CC BY 4.0.