Skip to content
GitHub Security Advisories·Indexed by this site · Originally published· Event →SelectedAttention37

rmcp OAuth client does not validate resource_metadata URL, has SSRF vulnerability

rmcp OAuth client fetches server-controlled resource_metadata URLs

AI summary

A GitHub security advisory discloses an SSRF vulnerability in the rmcp crate of modelcontextprotocol/rust-sdk, with the affected file being crates/rmcp/src/transport/auth.rs. Its OAuth client parses the absolute URL of resource_metadata= from the WWW-Authenticate header returned by the server and directly makes a GET request, without validating whether it is same-origin with the original MCP server or blocking loopback, link-local, RFC 1918 addresses, or cloud metadata endpoints. An attacker-controlled MCP server can return a 401 with a header pointing to internal addresses such as http://169.254.169.254/latest/meta-data/, causing the victim application to probe cloud metadata, localhost services, private VPC or container network services, and internal HTTP APIs using its network context.

Why it was selected

Disclosed an SSRF caused by the rmcp OAuth client not validating the resource_metadata URL, and provided fix ideas including same-origin validation and private network blocking.

Read originalgithub.com