CVE-2026-34237: Wildcard CORS in Java MCP Servers Turns Browsers into Relays
An analysis of CVE-2026-34237, a vulnerability in the official Java MCP SDK where HTTP transports defaulted to a wildcard CORS header, enabling browser-mediated
Security oversight has surfaced in a widely adopted standard protocol used to connect artificial intelligence models with local file systems, databases, and internal automation tools. An official Model Context Protocol Java SDK (io.modelcontextprotocol.sdk:mcp-core) was found to contain a configuration flaw in its HTTP transport module, inadvertently emitting a wildcard cross-origin resource sharing header to arbitrary websites.

Image source: https://dev.to/ioneyrezende/wildcard-cors-turns-an-mcp-server-into-a-browser-relay-b1o
Tracked as CVE-2026-34237 with a CVSS v3 severity score of 6.1, this vulnerability demonstrates how servers deployed in internal networks or local environments—traditionally shielded from direct external reach—can be exposed via web browsers as a relay for external attackers. This discovery challenges the common developer assumption that physical network isolation or local loopback placement eliminates the need for strict authentication and access boundaries.
Flawed Default Settings in Java MCP Transports
The Model Context Protocol (MCP) is an open standard that enables large language models to interact safely with local files, databases, and external APIs. Server applications implementing this protocol are typically placed on internal network addresses or local developer workstations where external scanners and public IP addresses cannot reach them. Traditional network design assumes that a web browser cannot freely read responses from such internal services.
However, the HTTP transport implementation in the official Java SDK, utilized by various MCP servers, added Access-Control-Allow-Origin: * by default in its response headers. Cross-Origin Resource Sharing (CORS) is a security mechanism that regulates resource sharing between different origins in web browsers. When a wildcard is specified, any website's script is permitted to read the server's responses freely. This behavior contrasted sharply with other language implementations, such as the Python SDK, which did not emit the wildcard header from either transport.
The Attack Mechanism: Leveraging the Browser as a Network Relay
The danger of this vulnerability lies in the fact that an attacker does not need a direct route to breach internal firewalls or reach the internal server. The moment a victim visits a malicious webpage, the browser can be instructed to open endpoints on the internal or local MCP server, such as server-sent event streams.
The victim's browser already possesses the reachability and ambient network trust required to access internal corporate network resources. Because the server response includes a wildcard header, the attacker's page can read the stream data, including the session identifier returned when the connection opens. Armed with this identifier, the page can send POST requests to the same MCP endpoint, allowing the attacker to remotely invoke tools that access local files or databases. In short, the victim's browser is co-opted as a proxy operating from within the secure network session.
Affected Version Ranges and Official Patches
According to the security advisory (GHSA-hv2w-8mjj-jw22), the affected version ranges for the Java MCP SDK package (io.modelcontextprotocol.sdk:mcp-core) are explicitly defined:
- Affected Versions: Ranges below 1.0.0, below 1.1.1, and below 0.18.3.
- Patched Releases: Fixed in versions
1.0.1,1.1.1, and0.18.3.
Development teams must immediately upgrade their dependencies using project build tools. While the CVSS v3 score is 6.1—reflecting the requirement that a user must visit a hostile page while the internal service is reachable—the operational reality is that employees frequently browse the web while connected to corporate networks, making endpoints vulnerable if they rely solely on user restraint.
Post-Patch Validation and Additional Security Measures
Upgrading the library package is only the first step. Teams must inspect deployed response headers at the actual ingress, servlet container, service mesh, and application endpoint layers. A reverse proxy or web server configuration might append or preserve a wildcard header even after the underlying library flaw is fixed.
If the service does not require browser-based clients, the Access-Control-Allow-Origin header should be removed entirely, restricting access to the intended network path. When specific web applications require cross-origin access, developers must allow only exact origins, restrict allowed headers, and handle credentials strictly according to secure design principles. Combining library patches with rigorous verification of authentication policies and network boundaries ensures that internal servers remain protected against browser-mediated relay attacks.
Sources
- Dev.to: Wildcard CORS turns an MCP server into a browser relay
- GitHub Security Advisory: GHSA-hv2w-8mjj-jw22