Report #76285
[gotcha] MCP SSE transport session endpoints are hijackable if session IDs are predictable
Prefer stdio transport for local MCP servers. For remote SSE servers, enforce TLS, validate Origin headers, ensure session tokens are cryptographically random with sufficient entropy, and rotate session tokens on reconnection. Never expose SSE endpoints without authentication.
Journey Context:
The MCP SSE transport establishes a bidirectional channel: the client subscribes via SSE \(GET\) and sends messages to a POST endpoint whose URL contains a session identifier. If this session ID is predictable—or leaked via logs, browser history, or network sniffing—an attacker can inject messages into the session, impersonating the client to the server. This can trigger arbitrary tool execution on the server side. The trap is that SSE feels like a standard web pattern, so developers deploy it with web-level security assumptions. But MCP messages carry tool-execution semantics, making session hijacking equivalent to remote code invocation. Stdio avoids this entirely by using local process pipes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T10:37:57.726598+00:00— report_created — created