Skip to content
Back to search

CVE-2026-77359

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/googlesky--cve-2026-77359/badge.svg)](/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
  1. # CVE-2026-77359 — jupyter-mcp-server: browser DNS rebinding hijacks the Jupyter backend via unprotected management routes
  2. [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
  3. [![Research status: validated](https://img.shields.io/badge/research-validated%20differential-success.svg)](#5-expected-results)
  4. | | |
  5. | --- | --- |
  6. | **CVE** | CVE-2026-77359 |
  7. | **Component** | jupyter-mcp-server — management routes (`/api/connect`, `/api/stop`) in standalone streamable-http mode |
  8. | **Affected** | <= 1.0.2 |
  9. | **Fixed in** | **1.0.3** — commit `c2e98fca` (GHSA-9x8x-crjq-g64h) |
  10. | **CWE** | CWE-350 (Reliance on Reverse DNS Resolution), CWE-346 (Origin Validation Error) |
  11. | **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 |
  12. | **Vector** | Browser DNS rebinding — victim visits a malicious site while the MCP server listens locally |
  13. | **Trigger** | `PUT /api/connect` with `Host: attacker.example:4040` / `Origin: http://attacker.example:4040` |
  14. The protected `/mcp` endpoint shows the intended boundary:
  15. ```text
  16. POST /mcp with Host: attacker.example:8142 / Origin: http://attacker.example:8142
  17. -> HTTP 421 Invalid Host header
  18. ```
  19. The vulnerable management route accepted the same forged headers; the fix adds
  20. the middleware:
  21. ```python
  22. # fixed (commit c2e98fca) — ManagementRouteSecurityMiddleware
  23. MANAGEMENT_ROUTE_PATHS = {"/api/connect", "/api/stop", "/api/healthz"}
  24. if not _is_local_hostname(request.url.hostname):
  25. return JSONResponse({"error": "Invalid Host header"}, status_code=421)
  26. # + Origin hostname check + authentication for /api/connect, /api/stop
  27. ```
  28. ---
  29. ## 1. Root cause
  30. In standalone `streamable-http` mode the server applies a browser-origin
  31. boundary (local `Host`/`Origin`, 421 otherwise) to the `/mcp` endpoint, but the
  32. custom management routes mounted on the same application (`/api/connect`,
  33. `/api/stop`, `/api/healthz`) did not receive that protection. With DNS rebinding,
  34. an attacker-controlled hostname resolves to `127.0.0.1` (or a private target),
  35. so the victim's browser sends a same-origin-looking request to the local MCP
  36. server while keeping the attacker origin. `PUT /api/connect` accepted the
  37. browser-shaped request and replaced the active Jupyter backend, making the
  38. server start a kernel client against attacker-controlled infrastructure. The fix
  39. adds `ManagementRouteSecurityMiddleware`, enforcing local `Host`/`Origin` (421 on
  40. forged values) and authentication on the management routes, matching the `/mcp`
  41. boundary.
  42. ## 2. Reproduction environment
  43. | service | image | role |
  44. | --- | --- | --- |
  45. | `jmcp-vuln` | `cve-2026-77359:vuln` | real jupyter-mcp-server **v1.0.2** |
  46. | `jmcp-fixed` | `cve-2026-77359:fixed` | real jupyter-mcp-server **v1.0.3** (vendor fix) |
  47. | `poc` | `cve-2026-77359-poc:local` | stdlib-only Python driver |
  48. Each image runs the real `jupyter-mcp-server --transport streamable-http
  49. --port 4040` with `MCP_TOKEN` set, under a supervisor exposing `/status` and
  50. `/restart`. The harness sends forged-`Host`/`Origin` requests to `/api/connect`
  51. (management) and `/mcp` (protected baseline). Both sides differ only in the
  52. jupyter-mcp-server version.
  53. ## 3. Running the environment
  54. ```sh
  55. ./run-lab.sh build # installs jupyter-mcp-server v1.0.2 / v1.0.3
  56. ./run-lab.sh up # cve77359lab network: jmcp-vuln / jmcp-fixed
  57. ./run-lab.sh sweep
  58. ./run-lab.sh down
  59. ```
  60. ## 4. The PoC
  61. `poc/poc.py` (stdlib only, forged `Host` via `skip_host`):
  62. * **check** — exit 1 when `/api/connect` accepts the rebinding request (not
  63. 421), 0 when it returns 421; 3 no worker, 2 unreachable/indeterminate.
  64. * **exploit** — narrated DNS-rebinding chain: malicious site → rebinding to
  65. 127.0.0.1 → `PUT /api/connect` replaces the Jupyter backend.
  66. * **probe** — `/api/connect` vs `/mcp` (baseline) under forged host.
  67. * **mitigation** — 1.0.3 / commit `c2e98fca` / `ManagementRouteSecurityMiddleware`.
  68. A standalone full-chain exploit ships at `exploit/exploit.py`:
  69. ```sh
  70. python3 exploit/exploit.py --host=jmcp-vuln
  71. # exit 1 on confirmed management-route acceptance, 0 on a safe target
  72. ```
  73. ## 5. Expected results
  74. | forged-host request | `jmcp-vuln` (1.0.2) | `jmcp-fixed` (1.0.3) |
  75. | --- | --- | --- |
  76. | `PUT /api/connect` | **500 (handler ran, NOT 421)** | 421 (Invalid Host) |
  77. | `POST /mcp` (baseline) | 421 | 421 |
  78. The vulnerable management route lets the rebinding request reach the connect
  79. handler (which would replace the backend); the fixed route rejects it at the
  80. origin boundary, exactly like `/mcp`.
  81. Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,
  82. `evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,
  83. `evidence/exploit-standalone-run.txt`, `evidence/exploit-standalone-fixed-run.txt`,
  84. `evidence/versions.txt`, `evidence/0day-sweep.txt`.
  85. ## 6. Environment preconditions
  86. * Podman (or Docker); bounded containers on the isolated `cve77359lab`
  87. network.
  88. * Real-world exploitation requires the victim to run jupyter-mcp-server in
  89. standalone streamable-http mode locally and visit a malicious website that
  90. performs DNS rebinding to the loopback/private address.
  91. ## 7. Additional findings (0-day sweep on the fixed line)
  92. The fixed `ManagementRouteSecurityMiddleware` applies local-`Host`/`Origin`
  93. checks (421 on forged) plus authentication to `/api/connect`, `/api/stop` and
  94. `/api/healthz`, matching the `/mcp` boundary. Forged-host management requests are
  95. rejected before reaching the handler; the `/mcp` baseline is unchanged (421). No
  96. DNS-rebinding management-route bypass remains.
  97. ## 8. Repository layout
  98. ```
  99. README.md this write-up
  100. run-lab.sh environment driver (build / up / sweep / down)
  101. Makefile convenience targets
  102. poc/poc.py the PoC (check / exploit / probe / mitigation)
  103. exploit/exploit.py standalone full-chain exploit
  104. lab/lab.Dockerfile installs both jupyter-mcp-server versions
  105. lab/supervisor.py runs the server + /status, /restart
  106. evidence/ captured runs of every mode on both sides
  107. TRACKING.md excluded (working record)
  108. ```
  109. ## 9. References
  110. * CVE record — https://www.cve.org/CVERecord?id=CVE-2026-77359
  111. * GitHub advisory — https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-9x8x-crjq-g64h
  112. * Fix commit — https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4d246fc5
  113. * Fixed release — jupyter-mcp-server 1.0.3

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.