GHSA-F8RF-RCRX-H6R9

Vulnerability from github – Published: 2026-11-30 20:39 – Updated: 2026-11-30 20:39
VLAI
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

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "jupyter-mcp-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.1.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-137189"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-346"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-30T20:39:44Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "## Summary\n\nThe 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\u0027s 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.\n\n## Details\n\n- `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).\n- Confirmed against the actual pinned dependency: `starlette==1.6.0`\u0027s `datastructures.py` builds `URL.netloc` from `scope[\"headers\"]`\u0027s 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.\n- `utils.py:429` - the server still binds `0.0.0.0` by default, so this is reachable from the network, not just localhost.\n\n## Proof of Concept\n\nStarted the real server (`--insecure-mcp-noauth --transport streamable-http`).\n\n`curl -X PUT /api/connect -H \"Host: evil.com\"` correctly returns 421 Misdirected Request.\n\nThe 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\u0027s `code_sandbox_url` with the attacker\u0027s URL, followed by the server actually attempting to connect a kernel to attacker infrastructure.\n\n## Scoping\n\nIn `--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\u0027t 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\u0027s entire security guarantee currently rests on this one check, and it fails completely.\n\n## Duplicate check\n\nBoth existing advisories were read in full - neither describes Host-header string forgery as a bypass mechanism (GHSA-9x8x\u0027s 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\u0027s no test for a forged `Host: localhost` from a genuinely non-local source, which is exactly the gap here.\n\n## Suggested Fix\n\nCheck 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.\n\nReported by: Syed Anas Mohiuddin, independent security researcher",
  "id": "GHSA-f8rf-rcrx-h6r9",
  "modified": "2026-11-30T20:39:44Z",
  "published": "2026-11-30T20:39:44Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-f8rf-rcrx-h6r9"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/commit/5db55d551f929a19b2acb6248385fc87383b419b"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/datalayer/jupyter-mcp-server"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/releases/tag/v2.1.3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Jupyter MCP Server: Host-header spoof bypasses the CVE-2026-77359/GHSA-9x8x-crjq-g64h fix"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.