GHSA-f8rf-rcrx-h6r9

Suggest an improvement
Source
https://github.com/advisories/GHSA-f8rf-rcrx-h6r9
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-f8rf-rcrx-h6r9/GHSA-f8rf-rcrx-h6r9.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f8rf-rcrx-h6r9
Aliases
Published
2026-11-30T20:39:44Z
Modified
2026-11-30T20:45:09Z
Severity
  • 9.3 (Critical) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N CVSS Calculator
Summary
Jupyter MCP Server: Host-header spoof bypasses the CVE-2026-77359/GHSA-9x8x-crjq-g64h fix
Details

Summary

The fix for CVE-2026-77359/CVE-2026-77318 (GHSA-9x8x-crjq-g64h) added a middleware that checks whether request.url.hostname is localhost/127.0.0.1/::1 before allowing access to the /api/connect, /api/stop, and /api/healthz management routes. That check reads Starlette's parsed URL, which is built from the client-supplied Host header whenever one is present - not from the actual TCP peer address. A single request with a forged Host: localhost header, regardless of where it actually originates, passes the check.

Details

  • jupyter_mcp_server/server.py:105-169 - ManagementRouteSecurityMiddleware.dispatch and _is_local_hostname (lines 110-111) do a pure string comparison against the parsed Host header, never referencing request.client or scope["client"] (confirmed via grep - neither appears anywhere in this file).
  • Confirmed against the actual pinned dependency: starlette==1.6.0's datastructures.py builds URL.netloc from scope["headers"]'s host entry (validated only against a syntax regex) whenever present, falling back to scope["server"] (the real bind address) only if the header is absent or malformed.
  • utils.py:429 - the server still binds 0.0.0.0 by default, so this is reachable from the network, not just localhost.

Proof of Concept

Started the real server (--insecure-mcp-noauth --transport streamable-http).

curl -X PUT /api/connect -H "Host: evil.com" correctly returns 421 Misdirected Request.

The same request with -H "Host: localhost" and a full attacker-controlled payload (code_sandbox_url, document_url, tokens) is accepted - server logs confirm the connect() handler ran, DocumentCodeSandbox(**data) validated, and set_config() overwrote the live server's code_sandbox_url with the attacker's URL, followed by the server actually attempting to connect a kernel to attacker infrastructure.

Scoping

In --mcp-token (secure) mode, /api/connect and /api/stop still correctly require a valid bearer token after the Host check passes, so the spoof alone doesn't achieve full config hijack there - only /api/healthz is reachable via the spoof in that mode, which is a lower-severity status/info-disclosure gap, not a full takeover. The full critical-severity impact (unauthenticated backend hijack) is specific to --insecure-mcp-noauth mode, which your own CLI already labels "NOT recommended for production" - but that mode's entire security guarantee currently rests on this one check, and it fails completely.

Duplicate check

Both existing advisories were read in full - neither describes Host-header string forgery as a bypass mechanism (GHSA-9x8x's PoC used DNS rebinding; this needs no DNS trickery at all, just one header). No commit since the fix (c2e98fc) has touched _is_local_hostname or the middleware. The existing regression test (tests/test_tools.py::test_management_routes_reject_forged_host) only asserts that a non-local-looking Host is rejected - there's no test for a forged Host: localhost from a genuinely non-local source, which is exactly the gap here.

Suggested Fix

Check the actual ASGI scope["client"] peer address (or require the literal TCP connection to be 127.0.0.1) instead of, or in addition to, the client-supplied Host header.

Reported by: Syed Anas Mohiuddin, independent security researcher

Database specific
{
    "cwe_ids":  [
        "CWE-346"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-11-30T20:39:44Z",
    "nvd_published_at":  null,
    "severity":  "CRITICAL"
}
References

Affected packages

PyPI / jupyter-mcp-server

Package

Name
jupyter-mcp-server
View open source insights on deps.dev
Purl
pkg:pypi/jupyter-mcp-server

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.1.3

Affected versions

0.*
0.1.0
0.2.0
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.4.0
0.5.0
0.6.0
0.7.0
0.8.0
0.9.0
0.10.0
0.10.2
0.11.0
0.12.0
0.13.0
0.14.0
0.15.0
0.15.1
0.15.2
0.15.4
0.16.0
0.16.1
0.16.2
0.16.3
0.17.0
0.18.0
0.18.1
0.18.2
0.19.0
0.20.1
0.21.0
0.21.1
0.21.2
0.22.0
0.22.1
0.23.0
1.*
1.0.0
1.0.2
1.0.3
1.0.4
1.0.5
1.0.6
1.1.0
1.1.1
1.1.2
1.1.3
1.1.4
1.2.0
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.3.6
1.3.7
1.3.8
1.4.0
1.4.1
1.4.2
1.4.3
1.4.4
1.4.5
1.5.0
1.5.2
1.5.3
2.*
2.0.0
2.1.0
2.1.1
2.1.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-f8rf-rcrx-h6r9/GHSA-f8rf-rcrx-h6r9.json"