SSRF and credential disclosure through MCP HTTP redirects (GO-2026-6911)

SSRF and credential disclosure through MCP HTTP redirects (GO-2026-6911)

Description

In github.com/mark3labs/mcp-go, NewStreamableHTTP, NewSSE, and NewOAuthHandler follow the default redirect policy unless supplied with a custom HTTP client. The SSE transport checks only the host of the endpoint supplied by the server, so it can accept a URL with a different scheme or port.

Potential impact

A malicious MCP or OAuth server may redirect requests to an internal network. Following a redirect can also disclose custom headers, OAuth credentials, or a request body to another destination.

Remediation

Update github.com/mark3labs/mcp-go to v1.5.1-0.20261109144041-2f5b9637ea84 or later. If you supply a custom HTTP client, restrict redirects to approved destinations and prevent credentials from being forwarded to another origin.

References