CVE-2026-34237
MCP Java SDK has a Hardcoded Wildcard CORS (Access-Control-Allow-Origin: *)
Description
Summary
Hardcoded Wildcard CORS (Access-Control-Allow-Origin: * )
- https://github.com/modelcontextprotocol/java-sdk/blob/main/mcp-core/src/main/java/io/modelcontextprotocol/server/transport/HttpServletSseServerTransportProvider.java#L289
- https://github.com/modelcontextprotocol/java-sdk/blob/main/mcp-core/src/main/java/io/modelcontextprotocol/server/transport/HttpServletStreamableServerTransportProvider.java#L525
Attack Scenario
An attacker-controlled web page instructs the victim's browser to open GET https://internal-mcp-server/sse. Because Access-Control-Allow-Origin: * allows cross-origin SSE reads, the attacker's page receives the endpoint event — which contains the session ID. The attacker can then POST to that endpoint from their page using the victim's browser as a relay.
Comparison with python-sdk
No Access-Control-Allow-Origin header is emitted by either Python transport. The browser's default same-origin policy remains in full effect. https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/sse.py https://github.com/modelcontextprotocol/python-sdk/blob/main/src/mcp/server/streamable_http.py
Recommendation
In the SDK, the transport layer should not own CORS policy. Server implementors who need cross-origin access can add a CORS filter at the servlet filter or Spring Security layer.
Reference
- https://cheatsheetseries.owasp.org/cheatsheets/HTTP_Headers_Cheat_Sheet.html#access-control-allow-origin
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| io.modelcontextprotocol.sdk » mcp-core | < 0.18.3>= 1.0.0, < 1.0.1>= 1.1.0, < 1.1.1 | 0.18.3, 1.0.1, 1.1.1 |
Blast radius
43% of the dependent artifacts (311) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 349 |
| 2 hops | 1,098 |
| 3 hops | 1,707 |
| 4 hops | 1,495 |
| 5 hops | 846 |
| 6 hops | 267 |
Most used dependents
- org.springframework.ai » spring-ai-client-chat282 usages
- io.modelcontextprotocol.sdk » mcp175 usages
- io.agentscope » agentscope-core96 usages
- org.springframework.ai » spring-ai-starter-model-openai85 usages
- org.springframework.ai » spring-ai-mcp74 usages
- org.springframework.ai » spring-ai-starter-mcp-server-webmvc74 usages
- io.modelcontextprotocol.sdk » mcp-json-jackson272 usages
- com.embabel.agent » embabel-agent-api67 usages
- org.springframework.ai » spring-ai-starter-mcp-server54 usages
- org.springframework.ai » spring-ai-starter-model-anthropic51 usages
- io.agentscope » agentscope-harness46 usages
- io.jaiclaw » jaiclaw-spring-boot-starter43 usages
- com.google.adk » google-adk41 usages
- com.yahoo.vespa » container-dev40 usages
- org.springframework.ai » spring-ai-autoconfigure-model-chat-client40 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Advisory | NVD CVE-2026-34237 | nvd.nist.gov |
| Package | modelcontextprotocol/java-sdk | github.com |
| Web | modelcontextprotocol/java-sdk advisory GHSA-hv2w-8mjj-jw22 | github.com |
| Web | cheatsheets/HTTP_Headers_Cheat_Sheet.html | cheatsheetseries.owasp.org |
| Web | modelcontextprotocol/java-sdk HttpServletSseServerTransportProvider.java | github.com |
| Web | modelcontextprotocol/java-sdk HttpServletStreamableServerTransportProvider.java | github.com |
