Skip to main content
Menu
Advisories

Unauthenticated access to proxied tools in container mode

GHSA-G879-4J4F-6VJ7Published Updated GitHub

Description

When the gateway runs in container mode, the bearer-token authentication middleware is never installed, so the HTTP MCP endpoints are served with no authentication.

Details

The auth token is only obtained/set for network transports when the process is not in a container (run.go, gated on DOCKER_MCP_IN_CONTAINER). transport.go installs the authentication middleware on /sse and /mcp only when the token is non-empty, so in container mode both handlers are unauthenticated. The listener binds to all interfaces (0.0.0.0), and the only remaining guard (originSecurityHandler) explicitly allows requests that carry no Origin header — which a non-browser client (curl/SDK) simply omits.

Impact

Any host that can reach the published port (a LAN peer, or another container on the same Docker network) gets full, unauthenticated use of every proxied MCP server — including tools that act with the user's stored secrets and OAuth tokens.

Preconditions

  • Gateway running in container mode with an HTTP transport and the port reachable by an untrusted host.

Workarounds

  • Do not publish/expose the gateway port to untrusted networks; bind it to loopback or a trusted network only.
  • Place the gateway behind an authenticating reverse proxy.

References

Affected versions

References

GitHub · docker/mcp-gateway