MCP Gateway: Authority-injection and JWT/session bypass via the unauthenticated router hair-pin "router-key" / "mcp-init-host" path
Critical severity
GitHub Reviewed
Published
May 13, 2026
in
Kuadrant/mcp-gateway
•
Updated May 19, 2026
Description
Published to the GitHub Advisory Database
May 19, 2026
Reviewed
May 19, 2026
Last updated
May 19, 2026
Summary
The MCP router (ext_proc) exposes an
initialize-method code path that, when arequest carries an
mcp-init-hostheader, bypasses the gateway JWT sessionvalidator and rewrites the upstream
:authorityheader to whatever the callerchooses, gated only by a single shared header value (
router-key). The sharedvalue is
secret-api-key) baked intocmd/mcp-broker-router/main.goas a fall-back default, and
MCPGatewayExtensionUID — a non-secret value visible to anyone withgetpermission on the resource, and additionally exposed in
argvbecause it ispassed to the broker-router container via
--mcp-router-key=....A request that satisfies the trivial header check is forwarded to any backend
listener registered with the gateway (including external services such as
api.githubcopilot.comwhen configured), bypassing both the broker (where thesigned
x-mcp-authorizedcapability filter is enforced) and the gateway'sJWT-based session model.
References