Back to search
CVE-2026-77359
MCP serverGitHub
jupyter-mcp-server <=1.0.2: /mcp rejected forged Host/Origin but management routes didn't — DNS-rebinding website PUT /api/connect replaces the Jupyter backend (kernel hijack). Real server v1.0.2 vs v1.0.3: /api/connect accepted (not 421) on vuln, ManagementRouteSecurityMiddleware 421 on fixed (c2e98fca).
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Badge for your README
Markdown
[](/listings/googlesky--cve-2026-77359)HTML
<a href="/listings/googlesky--cve-2026-77359"><img src="/api/listings/googlesky--cve-2026-77359/badge.svg" alt="findsafeskills safety rating" /></a>Install
i
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
README.md · README · 144 lines
- # CVE-2026-77359 — jupyter-mcp-server: browser DNS rebinding hijacks the Jupyter backend via unprotected management routes
- [](LICENSE)
- [](#5-expected-results)
- | | |
- | --- | --- |
- | **CVE** | CVE-2026-77359 |
- | **Component** | jupyter-mcp-server — management routes (`/api/connect`, `/api/stop`) in standalone streamable-http mode |
- | **Affected** | <= 1.0.2 |
- | **Fixed in** | **1.0.3** — commit `c2e98fca` (GHSA-9x8x-crjq-g64h) |
- | **CWE** | CWE-350 (Reliance on Reverse DNS Resolution), CWE-346 (Origin Validation Error) |
- | **Impact** | Standalone streamable-http mode rejects forged `Host`/`Origin` on `/mcp`, but the custom management routes lacked the same browser-origin protection; a malicious website whose hostname resolves to `127.0.0.1` (DNS rebinding) can `PUT /api/connect` with an attacker origin and replace the MCP server's active Jupyter backend, starting a kernel client against attacker-controlled infrastructure |
- | **Vector** | Browser DNS rebinding — victim visits a malicious site while the MCP server listens locally |
- | **Trigger** | `PUT /api/connect` with `Host: attacker.example:4040` / `Origin: http://attacker.example:4040` |
- The protected `/mcp` endpoint shows the intended boundary:
- ```text
- POST /mcp with Host: attacker.example:8142 / Origin: http://attacker.example:8142
- -> HTTP 421 Invalid Host header
- ```
- The vulnerable management route accepted the same forged headers; the fix adds
- the middleware:
- ```python
- # fixed (commit c2e98fca) — ManagementRouteSecurityMiddleware
- MANAGEMENT_ROUTE_PATHS = {"/api/connect", "/api/stop", "/api/healthz"}
- if not _is_local_hostname(request.url.hostname):
- return JSONResponse({"error": "Invalid Host header"}, status_code=421)
- # + Origin hostname check + authentication for /api/connect, /api/stop
- ```
- ---
- ## 1. Root cause
- In standalone `streamable-http` mode the server applies a browser-origin
- boundary (local `Host`/`Origin`, 421 otherwise) to the `/mcp` endpoint, but the
- custom management routes mounted on the same application (`/api/connect`,
- `/api/stop`, `/api/healthz`) did not receive that protection. With DNS rebinding,
- an attacker-controlled hostname resolves to `127.0.0.1` (or a private target),
- so the victim's browser sends a same-origin-looking request to the local MCP
- server while keeping the attacker origin. `PUT /api/connect` accepted the
- browser-shaped request and replaced the active Jupyter backend, making the
- server start a kernel client against attacker-controlled infrastructure. The fix
- adds `ManagementRouteSecurityMiddleware`, enforcing local `Host`/`Origin` (421 on
- forged values) and authentication on the management routes, matching the `/mcp`
- boundary.
- ## 2. Reproduction environment
- | service | image | role |
- | --- | --- | --- |
- | `jmcp-vuln` | `cve-2026-77359:vuln` | real jupyter-mcp-server **v1.0.2** |
- | `jmcp-fixed` | `cve-2026-77359:fixed` | real jupyter-mcp-server **v1.0.3** (vendor fix) |
- | `poc` | `cve-2026-77359-poc:local` | stdlib-only Python driver |
- Each image runs the real `jupyter-mcp-server --transport streamable-http
- --port 4040` with `MCP_TOKEN` set, under a supervisor exposing `/status` and
- `/restart`. The harness sends forged-`Host`/`Origin` requests to `/api/connect`
- (management) and `/mcp` (protected baseline). Both sides differ only in the
- jupyter-mcp-server version.
- ## 3. Running the environment
- ```sh
- ./run-lab.sh build # installs jupyter-mcp-server v1.0.2 / v1.0.3
- ./run-lab.sh up # cve77359lab network: jmcp-vuln / jmcp-fixed
- ./run-lab.sh sweep
- ./run-lab.sh down
- ```
- ## 4. The PoC
- `poc/poc.py` (stdlib only, forged `Host` via `skip_host`):
- * **check** — exit 1 when `/api/connect` accepts the rebinding request (not
- 421), 0 when it returns 421; 3 no worker, 2 unreachable/indeterminate.
- * **exploit** — narrated DNS-rebinding chain: malicious site → rebinding to
- 127.0.0.1 → `PUT /api/connect` replaces the Jupyter backend.
- * **probe** — `/api/connect` vs `/mcp` (baseline) under forged host.
- * **mitigation** — 1.0.3 / commit `c2e98fca` / `ManagementRouteSecurityMiddleware`.
- A standalone full-chain exploit ships at `exploit/exploit.py`:
- ```sh
- python3 exploit/exploit.py --host=jmcp-vuln
- # exit 1 on confirmed management-route acceptance, 0 on a safe target
- ```
- ## 5. Expected results
- | forged-host request | `jmcp-vuln` (1.0.2) | `jmcp-fixed` (1.0.3) |
- | --- | --- | --- |
- | `PUT /api/connect` | **500 (handler ran, NOT 421)** | 421 (Invalid Host) |
- | `POST /mcp` (baseline) | 421 | 421 |
- The vulnerable management route lets the rebinding request reach the connect
- handler (which would replace the backend); the fixed route rejects it at the
- origin boundary, exactly like `/mcp`.
- Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,
- `evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,
- `evidence/exploit-standalone-run.txt`, `evidence/exploit-standalone-fixed-run.txt`,
- `evidence/versions.txt`, `evidence/0day-sweep.txt`.
- ## 6. Environment preconditions
- * Podman (or Docker); bounded containers on the isolated `cve77359lab`
- network.
- * Real-world exploitation requires the victim to run jupyter-mcp-server in
- standalone streamable-http mode locally and visit a malicious website that
- performs DNS rebinding to the loopback/private address.
- ## 7. Additional findings (0-day sweep on the fixed line)
- The fixed `ManagementRouteSecurityMiddleware` applies local-`Host`/`Origin`
- checks (421 on forged) plus authentication to `/api/connect`, `/api/stop` and
- `/api/healthz`, matching the `/mcp` boundary. Forged-host management requests are
- rejected before reaching the handler; the `/mcp` baseline is unchanged (421). No
- DNS-rebinding management-route bypass remains.
- ## 8. Repository layout
- ```
- README.md this write-up
- run-lab.sh environment driver (build / up / sweep / down)
- Makefile convenience targets
- poc/poc.py the PoC (check / exploit / probe / mitigation)
- exploit/exploit.py standalone full-chain exploit
- lab/lab.Dockerfile installs both jupyter-mcp-server versions
- lab/supervisor.py runs the server + /status, /restart
- evidence/ captured runs of every mode on both sides
- TRACKING.md excluded (working record)
- ```
- ## 9. References
- * CVE record — https://www.cve.org/CVERecord?id=CVE-2026-77359
- * GitHub advisory — https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-9x8x-crjq-g64h
- * Fix commit — https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4d246fc5
- * Fixed release — jupyter-mcp-server 1.0.3
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.