Friday, 4 December 2026
4 agent hacks today▼ 3 vs yesterday (7)

Forged Host header reopens Jupyter MCP Server takeover flaw

A one-line header trick defeats the localhost check that was meant to protect the agent server's management routes, according to a GitHub advisory published on 30 November 2026.

By The Agentic Times ·

A locked gate with "localhost only" written on it swings open as an intruder whispers a false name through the bars, bypassing the guard's verification.
A locked gate with "localhost only" written on it swings open as an intruder whispers a false name through the bars, bypassing the guard's verification. · Illustration: The Agentic Times

A security advisory published on 30 November 2026 says the fix for an earlier Jupyter MCP Server flaw can be defeated with a single forged HTTP header, allowing an attacker on the network to take over the server's configuration when it runs in its insecure, no-authentication mode.

The issue is tracked as CVE-2026-137189 in advisory GHSA-f8rf-rcrx-h6r9, and affects the Python package jupyter-mcp-server. MCP servers act as bridges between AI agents and tools or data, and this one connects agents to Jupyter notebook environments.

According to the advisory, the earlier fix for CVE-2026-77359 and CVE-2026-77318 added middleware that only allows access to the /api/connect, /api/stop and /api/healthz management routes if the request hostname is localhost, 127.0.0.1 or ::1. The problem is where that hostname comes from. The check reads the URL as parsed by Starlette, the web framework the server uses, and Starlette builds that value from the client-supplied Host header whenever one is present. It falls back to the real bind address only when the header is missing or malformed.

That means a request arriving from anywhere on the network with a Host header set to "localhost" passes the check. The advisory says the middleware code never consults the actual TCP peer address exposed in the ASGI request scope, and that the server still binds to 0.0.0.0 by default, so the routes are reachable from the network rather than only from the local machine.

The reporter demonstrated this against a running server started with the --insecure-mcp-noauth and --transport streamable-http options. A request with a Host header of "evil.com" was correctly rejected with a 421 Misdirected Request response. The same request with "Host: localhost" and an attacker-controlled payload was accepted. Server logs confirmed that the connect handler ran, the payload validated, and the live configuration's code sandbox URL was overwritten with the attacker's address. The server then attempted to connect a kernel to the attacker's infrastructure.

The advisory scopes the most serious impact to the insecure mode. When the server runs with the --mcp-token option, the /api/connect and /api/stop routes still require a valid bearer token after the host check passes, so the spoof alone does not achieve a full configuration hijack. In that mode only /api/healthz is reachable, which the advisory describes as a lower-severity status and information-disclosure gap. The insecure mode is already labelled by the project's own command-line interface as "NOT recommended for production", but the advisory notes that the mode's entire security guarantee rests on the single check that fails.

The reporter says both earlier advisories were read in full and neither describes Host header forgery as a bypass route. The proof of concept for the earlier issue relied on DNS rebinding, while this one needs no DNS manipulation at all. No commit since the original fix has touched the hostname helper or the middleware, according to the advisory, and the existing regression test only checks that a non-local-looking Host value is rejected. There is no test for a forged localhost header arriving from a genuinely remote source.

The suggested fix is to check the actual ASGI client peer address, or require the literal TCP connection to come from 127.0.0.1, instead of or in addition to the client-supplied header. The advisory credits independent security researcher Syed Anas Mohiuddin. It is listed as reported.

Sources

  1. github.comhttps://github.com/advisories/GHSA-f8rf-rcrx-h6r9