Report #17064
[gotcha] My MCP SSE server is receiving requests from unknown origins
MCP servers using SSE transport MUST validate the Origin header on all incoming HTTP connections. Never rely solely on the session ID for authentication. Bind sessions to their originating origin and reject cross-origin requests.
Journey Context:
The MCP SSE transport uses a session ID sent as a query parameter on the POST endpoint. This session ID is the only mechanism authenticating subsequent requests to the server. If the server does not validate the Origin header, any malicious webpage can make requests to the MCP server if it can guess or obtain the session ID. Since the session ID appears in the URL, it may leak through browser history, referrer headers, or server logs. The surprising part: developers assume localhost services are safe from cross-origin attacks, but a malicious webpage can reach localhost services via fetch from the user's browser. The MCP spec explicitly warns about this, but most SSE server implementations skip Origin validation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:21:22.772948+00:00— report_created — created