Summary
The Go MCP SDK's Streamable HTTP transport previously accepted browser-generated cross-site POST requests without validating the Origin header or enforcing an application/json content type.
In deployments without authorization, especially stateless or sessionless setups, this allows arbitrary websites to send MCP requests to a local server and potentially trigger tool execution in the user's environment.
Affected context
This vulnerability affects applications built with the Go MCP SDK that expose the Streamable HTTP transport to browser-accessible origins.
It is most relevant when:
- The MCP endpoint is reachable from a user's browser (e.g., localhost or internal services)
- The deployment omits authentication or session-based authorization
- The server accepts generic POST requests without strict content-type checks
In such configurations, the MCP server unintentionally becomes callable from arbitrary websites visited by the user.
Exploit preconditions
- Attack surface: HTTP endpoint implementing the Go MCP SDK Streamable transport, reachable from a browser controlled by the attacker's web page.
- Required access: Ability to lure a victim into visiting a malicious or compromised website in a browser that can reach the MCP endpoint (e.g., on localhost or an internal host).
- Trigger point: The malicious website issues cross-site POST requests (e.g., via forms, fetch/XHR) to the MCP HTTP endpoint.
- Why exploitation is possible: The server did not validate the Origin header and did not require Content-Type: application/json, so browser-generated cross-site requests were accepted and processed as legitimate MCP requests even in unauthenticated deployments.
Why this happens
The underlying flaw is a missing cross-site request protection on the Streamable HTTP transport in the Go MCP SDK.
The handler trusted any incoming POST request as long as it reached the endpoint, without enforcing CSRF-related checks such as Origin/Referer validation or strict JSON content-type constraints.
This aligns with CWE-352, where state-changing or sensitive actions are exposed over HTTP without robust verification that the request was intentionally initiated by the legitimate client context.
In stateless or sessionless deployments, the lack of additional authorization layers amplifies the impact, allowing cross-site requests to trigger tool execution workflows.
Potential impact
- An arbitrary website may cause the MCP server to execute tools or actions on behalf of the user's environment.
- Attacker-controlled web pages could send crafted MCP requests to a local or internal MCP endpoint reachable from the victim's browser.
- Unauthorized queries or commands could be routed through the MCP tools, potentially affecting connected systems or data.
- Users may experience unintended side effects or data modification initiated by malicious cross-site interactions.
General mitigation guidance
Effective mitigation focuses on strengthening request origin validation and reducing implicit trust in browser-sourced traffic:
- Enforce Origin and/or Referer checks on the MCP HTTP endpoint, rejecting requests from untrusted or unexpected origins.
- Require Content-Type: application/json for MCP POST requests and reject requests with other or missing content types.
- Introduce explicit authentication or authorization for MCP endpoints, even in seemingly local or developer-focused deployments.
- Isolate MCP services from direct browser access where possible (e.g., bind to non-routable interfaces, use intermediaries that enforce strict policies).
- Apply least-privilege to tools and back-end integrations invoked by MCP, so that unexpected requests have limited effect.
How teams detect issues like this
Detection typically involves scrutinizing how HTTP endpoints validate cross-site requests:
- Use static analysis or code search to identify MCP Streamable HTTP handlers that process POST requests without checking Origin/Referer or enforcing Content-Type: application/json.
- During code review, flag handlers that perform state-changing operations or tool invocations without CSRF controls or explicit authentication.
- Add application-level logging of Origin, Referer, and Content-Type for incoming MCP requests, and monitor for unexpected external origins.
- Incorporate security tests that simulate cross-site POSTs from a test website to validate that untrusted origins are properly rejected.

