Report #94248
[gotcha] Local MCP SSE server exploited by malicious website via DNS rebinding or permissive CORS
Strictly validate the \`Origin\` header on local MCP SSE servers. Do not set CORS to \`\*\`. Bind to loopback explicitly and implement DNS rebinding protections \(e.g., checking Host header\).
Journey Context:
Local MCP servers often use SSE over HTTP on localhost. Developers frequently set \`Access-Control-Allow-Origin: \*\` during development to easily connect web-based clients. A malicious website can make requests to \`localhost:PORT\` to invoke tools. Because browsers enforce CORS, a permissive CORS policy allows the attacker's site to read tool results \(which might contain local file contents\) and send commands. The assumption that localhost is safe from web attacks is fatal here.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:46:56.903782+00:00— report_created — created