Skip to main content
Menu
Advisories

SSRF via attacker-controlled remote server URL

GHSA-625J-RW87-4GHRPublished Updated GitHub

Description

A server definition's remote URL is dialed by the gateway with no host/range allowlist, allowing server-side requests to internal addresses.

Details

When the client pool lazily creates a client, the remote branch (clientpool.go GetClient) calls NewRemoteMCPClient for any server whose remote URL (or the deprecated SSE endpoint) is set, and remote.go dials it. The registry import path validates only the URL scheme (http/https) and ParseServerURL accepts any host. A server definition from untrusted content can drive the gateway to issue outbound requests to arbitrary internal addresses, including the cloud instance-metadata endpoint on a link-local address. Sibling unguarded fetch paths exist in the catalog/fetch/import code.

Impact

The gateway can be induced to make requests to internal services or the instance-metadata endpoint, reaching hosts an external attacker could not otherwise contact (blind/partial SSRF — the outbound request reaches the target even though the response must look like an MCP stream to be processed further).

Preconditions

  • A server definition with an attacker-chosen remote URL is loaded (untrusted import/catalog/registry content).

Workarounds

  • Restrict the gateway's outbound network access (egress proxy / network policy) to block link-local, loopback, and private ranges.
  • Only load server definitions from trusted sources.

References

Affected versions

References

GitHub · docker/mcp-gateway