{"id":"GO-2026-6911","aliases":["GO-2026-6911"],"related":[],"kind":"vulnerability","state":"published","title":"SSRF and credential leak via unvalidated redirects and SSE endpoint origin in github.com/mark3labs/mcp-go","summary":"In github.com/mark3labs/mcp-go/client/transport, NewStreamableHTTP, NewSSE, and NewOAuthHandler construct default http.Client instances with a nil CheckRedirect policy when no custom HTTP client (WithHTTPBasicClient, WithHTTPClient, or OAuthConfig.HTTPClient) is supplied. Additionally, SSE.handleSSEEvent validates the server-supplied endpoint event URL only against the connection's host, without verifying the scheme or port.\n\nWhen an MCP or OAuth server responds with a 3xx redirect, net/http follows up to 10 http or https redirects to arbitrary origins:\n- Custom headers configured via WithHTTPHeaders, WithHTTPHeaderFunc, WithHeaders, or WithHeaderFunc are copied onto requests to any redirect host.\n- The Authorization header (including OAuth bearer tokens) is preserved when redirecting to the same host or a subdomain, including across port changes or https-to-http scheme downgrades.\n- On 307 and 308 redirects, the request body is resent to the redirect target, exposing JSON-RPC payloads on transport requests and form bodies containing client_secret, authorization codes, or refresh tokens on OAuth token, refresh, and client registration requests.\n\nThis enables server-side request forgery (SSRF) and credential or payload disclosure.","summaryFormat":"markdown","summarySource":"go","descriptions":[{"lang":"en","text":"In github.com/mark3labs/mcp-go/client/transport, NewStreamableHTTP, NewSSE, and NewOAuthHandler construct default http.Client instances with a nil CheckRedirect policy when no custom HTTP client (WithHTTPBasicClient, WithHTTPClient, or OAuthConfig.HTTPClient) is supplied. Additionally, SSE.handleSSEEvent validates the server-supplied endpoint event URL only against the connection's host, without verifying the scheme or port.\n\nWhen an MCP or OAuth server responds with a 3xx redirect, net/http follows up to 10 http or https redirects to arbitrary origins:\n- Custom headers configured via WithHTTPHeaders, WithHTTPHeaderFunc, WithHeaders, or WithHeaderFunc are copied onto requests to any redirect host.\n- The Authorization header (including OAuth bearer tokens) is preserved when redirecting to the same host or a subdomain, including across port changes or https-to-http scheme downgrades.\n- On 307 and 308 redirects, the request body is resent to the redirect target, exposing JSON-RPC payloads on transport requests and form bodies containing client_secret, authorization codes, or refresh tokens on OAuth token, refresh, and client registration requests.\n\nThis enables server-side request forgery (SSRF) and credential or payload disclosure.","format":"markdown","source":"go"}],"published":"2026-11-05T22:55:15.000Z","modified":"2026-11-23T20:30:11.374Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.1-0.20261109144041-2f5b9637ea84"}],"ecosystem":"Go","package":"github.com/mark3labs/mcp-go","purl":"pkg:golang/github.com/mark3labs/mcp-go","source":"go"}],"references":[{"url":"https://github.com/mark3labs/mcp-go/commit/2f5b9637ea843f918889293b8d08d600e13b18e2","tags":["fix"],"sources":["go"]},{"url":"https://github.com/mark3labs/mcp-go/pull/1192","tags":["fix"],"sources":["go"]},{"url":"https://github.com/mark3labs/mcp-go/issues/1188","tags":["report"],"sources":["go"]}],"credits":["Dennis (denniszag)","Muhammad Hamizi Jaminan (hymns)"],"sources":[{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6911","url":"https://pkg.go.dev/vuln/GO-2026-6911","licence":"CC-BY-4.0","modified":"2026-11-23T20:30:11.374Z"}],"updatedAt":"2026-11-25T22:56:25.588Z"}