/

CVE-2026-33252

Severity:

HIGH RISK

(7.1)

CSRF in Go MCP SDK Streamable HTTP Transport

CVE-2026-33252

Analyzed

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Cross-Site Request Forgery leading to unauthorized tool invocation

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/modelcontextprotocol/go-sdk/commit/a433a831d6e5d5ac3b9e625a8095aa8eaa040dfc
github.comgithub.com/modelcontextprotocol/go-sdk/security/advisories/GHSA-89xv-2j6f-qhc8

Frequently asked

questions

It can be, if the MCP HTTP endpoint is reachable from the victim's browser and an attacker can entice the victim to visit a malicious website. In many setups this is limited to local or internal access, but the risk depends on network exposure.

Not necessarily. The issue is most severe in deployments that do not use authentication or that operate in a stateless/sessionless mode, where any accepted HTTP request can trigger MCP actions.

Combine strict Origin/Referer validation with enforcement of Content-Type: application/json and introduce explicit authentication or authorization controls for MCP endpoints, ensuring only trusted clients can issue requests.

Treat any browser-accessible HTTP endpoint that performs state-changing or sensitive operations as requiring CSRF protection and strong access control. Make Origin validation, strict content-type checks, and authentication standard patterns when designing new transports or APIs.

Find out what's already
exploitable in your codebase.