{"answers":{"affected":"2 open source packages ship an affected version, including rmcp.","exploited":"There is no known exploitation of GHSA-c9xm-49cp-xcr9 in the wild and no public exploit code.","fix":"Upgrade rmcp to 2.0.0 or later.","what":"GHSA-c9xm-49cp-xcr9 is a server-side request forgery vulnerability in rmcp, published on 2 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-c9xm-49cp-xcr9 and fix it if it is affected.\n\nWhat it is: GHSA-c9xm-49cp-xcr9 is a server-side request forgery vulnerability in rmcp, published on 2 Oct 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-c9xm-49cp-xcr9 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- rmcp (crates.io): affected all versions; fixed in 2.0.0\n- rmcp (crates.io): affected all versions; fixed in 2.0.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-c9xm-49cp-xcr9/ (Markdown: https://insights.sbomify.com/GHSA-c9xm-49cp-xcr9/index.md)","id":"GHSA-c9xm-49cp-xcr9","markdown":"https://insights.sbomify.com/GHSA-c9xm-49cp-xcr9/index.md","name":"GHSA-c9xm-49cp-xcr9","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"patch","impacts":["data_read","security_bypass"],"network_reachable":"yes","non_default_config":false,"product_category":"Rust MCP SDK","requires_auth":"none","summary":"An attacker-controlled MCP server can force the rmcp OAuth client to fetch internal URLs via SSRF, potentially exposing sensitive internal data or metadata.","user_interaction":"not_required","vuln_class":"ssrf"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\nThe `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.\n\nAn 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.\n\n## Affected version\n\n- Repository: `modelcontextprotocol/rust-sdk`\n- Crate: `rmcp`\n- Current `main` reviewed: `c330fede90e4729c234f8e87fdbc5ea27a1dd10c`\n- Commit date: 2026-05-19\n- Affected file: `crates/rmcp/src/transport/auth.rs`\n- File blob: `3aa3e91310662c409af9dc38c9d584d6df217e9c`\n- Severity framing: High/Medium SSRF, depending on the embedding application's network position and whether response parsing gives the attacker useful success/failure or chained fetch behavior.\n\n## Source evidence\n\n`extract_www_authenticate_params()` accepts an absolute URL from the server-controlled header:\n\n```rust\nlet resource_key = \"resource_metadata=\";\nwhile let Some(pos) = header_lowercase[search_offset..].find(resource_key) {\n    let global_pos = search_offset + pos + resource_key.len();\n    let value_slice = \u0026header[global_pos..];\n    if let Some((value, consumed)) = Self::parse_next_header_value(value_slice) {\n        if let Ok(url) = Url::parse(\u0026value) {\n            params.resource_metadata_url = Some(url);\n            break;\n        }\n        if let Ok(url) = base_url.join(\u0026value) {\n            params.resource_metadata_url = Some(url);\n            break;\n        }\n```\n\nThere 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.\n\n`fetch_resource_metadata_from_url()` then performs the GET:\n\n```rust\nlet response = match self\n    .http_client\n    .get(resource_metadata_url.clone())\n    .header(HEADER_MCP_PROTOCOL_VERSION, \"2024-11-05\")\n    .send()\n    .await\n```\n\nAgain, there is no same-origin, scheme, host, DNS, or IP-range validation before the request.\n\n## Attack scenario\n\n1. A Rust MCP client using `rmcp` connects to an attacker-controlled MCP server, or to a compromised MCP server.\n2. The server responds to OAuth discovery with a `401` and a `WWW-Authenticate` header such as:\n\n```text\nWWW-Authenticate: Bearer resource_metadata=\"http://169.254.169.254/latest/meta-data/\"\n```\n\n3. The client parses the `resource_metadata` value as a URL.\n4. The client sends a GET request to that URL from the victim application's network context.\n\nThis 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.\n\n## Impact\n\nThe direct impact is SSRF from any application embedding the rmcp OAuth client. Depending on where the client runs, this can reach:\n\n- cloud metadata endpoints;\n- localhost-only services;\n- private VPC or container-network services;\n- internal HTTP APIs not reachable from the attacker.\n\nThe 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.\n\n## Public duplicate check\n\nOn 2026-05-27:\n\n- Visible repository advisories were:\n  - `GHSA-9g45-5xwm-f3wc`: custom HTTP headers leak to cross-origin redirect targets.\n  - `GHSA-89vp-x53w-74fx`: DNS rebinding in Streamable HTTP server transport.\n- Public issue search for `WWW-Authenticate resource_metadata SSRF` returned no open or closed matches.\n- Public issue search for `resource_metadata` returned one closed implementation issue, `#517`, about authorization discovery fallback behavior, not SSRF/resource validation.\n\nThis report is distinct from the redirect-header advisory and the DNS-rebinding advisory.\n\n## Suggested fix\n\nBefore accepting or fetching a `resource_metadata` URL:\n\n- require the URL to be same-origin with the original MCP server URL, unless the spec intentionally permits a narrow trusted exception;\n- reject loopback, link-local, RFC 1918, unique-local IPv6, and known cloud metadata hostnames;\n- reject non-HTTP(S) schemes;\n- apply the same validation to redirect targets and any follow-on metadata URLs.\n\nA minimal same-origin check would compare scheme, host, and effective port:\n\n```rust\nfn is_same_origin(base: \u0026Url, candidate: \u0026Url) -\u003e bool {\n    base.scheme() == candidate.scheme()\n        \u0026\u0026 base.host() == candidate.host()\n        \u0026\u0026 base.port_or_known_default() == candidate.port_or_known_default()\n}\n```\n\nIf cross-origin `resource_metadata` is required for compatibility, it should be explicitly opted into and protected by private-network blocking.","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"rmcp OAuth client fetches server-controlled resource_metadata URLs","id":"GHSA-c9xm-49cp-xcr9","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"ssrf","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["2.0.0"],"introduced":["0"],"last_affected":[],"package":"rmcp","purl":null,"source":"GHSA-c9xm-49cp-xcr9"},{"ecosystem":"crates.io","fixed":["2.0.0"],"introduced":["0"],"last_affected":[],"package":"rmcp","purl":"pkg:cargo/rmcp","source":"GHSA-c9xm-49cp-xcr9"}],"products":null,"published":"2026-10-02","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An attacker-controlled MCP server can force the rmcp OAuth client to fetch internal URLs via SSRF, potentially exposing sensitive internal data or metadata.","url":"https://insights.sbomify.com/GHSA-c9xm-49cp-xcr9/"}