Report #91763
[gotcha] MCP SSE transport vulnerable to session hijacking when origin and session identity are unvalidated
Validate the Origin header on all incoming SSE connections. Use cryptographically random session tokens of at least 128 bits. Bind sessions to the originating client identity and reject messages from unrecognized origins. Implement session revocation and rotation. Prefer the stdio transport for local-only use cases where SSE is not required.
Journey Context:
The MCP SSE transport allows servers to push messages to clients over a persistent HTTP connection. If session identifiers are predictable, or if the server does not validate the origin of incoming POST messages to the session endpoint, an attacker who can reach the endpoint can inject messages into an existing session. This means the attacker can send fake tool results, inject tool call responses, or manipulate the conversation — all without direct access to the LLM context. The attack surface is the transport layer, but the impact is full prompt injection at the application layer. This is especially dangerous in development environments where MCP servers listen on localhost but browser-based attackers can reach localhost endpoints via DNS rebinding or malicious pages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:36:57.701081+00:00— report_created — created