Skip to content
Back to search

CVE-2026-77318

jupyter-mcp-server <1.0.3: standalone streamable-http management routes /api/connect and /api/stop skip MCP_TOKEN enforcement — an unauthenticated PUT resets the server context and points it at an attacker Jupyter backend. Real server v1.0.2 vs vendor-fixed v1.0.3: handler runs on vuln, 401 on fixed.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/googlesky--cve-2026-77318/badge.svg)](/listings/googlesky--cve-2026-77318)

HTML

<a href="/listings/googlesky--cve-2026-77318"><img src="/api/listings/googlesky--cve-2026-77318/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 · 129 lines
  1. # CVE-2026-77318 — Jupyter MCP Server: unauthenticated management routes hijack the Jupyter backend
  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-77318 |
  7. | **Component** | datalayer/jupyter-mcp-server — standalone `streamable-http` management routes (`server.py`) |
  8. | **Affected** | `< 1.0.3` |
  9. | **Fixed in** | **1.0.3** — genuine vendor fix, commit `c2e98fca` (PR #262) |
  10. | **CWE** | CWE-306 (Missing Authentication for Critical Function) |
  11. | **Impact** | An unauthenticated network caller can `PUT /api/connect` to reset the server context and point the MCP server at an attacker-controlled Jupyter runtime/document URL and token — backend hijack, despite `/mcp` requiring `MCP_TOKEN` |
  12. | **Vector** | Network — management routes mounted on the same Starlette app as `/mcp` |
  13. | **Trigger** | `PUT /api/connect` with no `Authorization` header |
  14. In standalone `streamable-http` mode the `/mcp` endpoint enforces
  15. `MCP_TOKEN`, but the custom management routes (`/api/connect`, `/api/stop`)
  16. were mounted without that enforcement. The fix adds
  17. `ManagementRouteSecurityMiddleware`:
  18. ```python
  19. # v1.0.3 — management routes now require a Bearer token
  20. if self._token_verifier and _is_authenticated_management_route(path):
  21. scheme, _, token = request.headers.get("authorization", "").partition(" ")
  22. if scheme.lower() != "bearer" or not token:
  23. return JSONResponse({"error": "invalid_token"}, status_code=401)
  24. ```
  25. ---
  26. ## 1. Root cause
  27. Authentication was applied at the MCP transport layer (`/mcp`) but not to
  28. the auxiliary management routes that mutate the same server configuration
  29. singleton. `connect` calls `set_config(...)` and `ServerContext.reset()`,
  30. then starts a kernel client against the supplied URLs — so an unauthenticated
  31. request redirects the whole server to an attacker backend. The fix moves the
  32. token check into middleware covering the management routes, plus local
  33. Host/Origin checks to block browser-based abuse.
  34. ## 2. Reproduction environment
  35. | service | image | role |
  36. | --- | --- | --- |
  37. | `jmcp-vuln` | `cve-2026-77318:vuln` | jupyter-mcp-server **v1.0.2** |
  38. | `jmcp-fixed` | `cve-2026-77318:fixed` | jupyter-mcp-server **v1.0.3** (vendor fix) |
  39. | `poc` | `cve-2026-77318-poc:local` | stdlib-only Python driver |
  40. Both run with `MCP_TOKEN=lab-secret-token --transport streamable-http
  41. --port 4040`. A supervisor exposes `/status` (server log tail) and
  42. `/restart` on :8081 so each probe starts from a clean log. Dependency pins
  43. (`jupyter-kernel-client==0.9.0`, `mcp<2`) are required to run the v1.0.x
  44. code against current PyPI releases.
  45. ## 3. Running the environment
  46. ```sh
  47. ./run-lab.sh build # pip-installs both upstream tags
  48. ./run-lab.sh up # cve77318lab network: jmcp-vuln / jmcp-fixed
  49. ./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
  50. ./run-lab.sh down
  51. ```
  52. ## 4. The PoC
  53. `poc/poc.py` (stdlib only):
  54. * **check** — `PUT /api/connect` without a token; exit 1 when the handler
  55. runs (log marker / non-401), 0 on 401; 3 no worker, 2 unreachable.
  56. * **exploit** — narrated stages with the server log line proving the
  57. context reset.
  58. * **probe** — connect / stop / healthz matrix.
  59. * **mitigation** — 1.0.3 / commit `c2e98fca`.
  60. A standalone full-chain exploit ships at `exploit/exploit.py`:
  61. ```sh
  62. python3 exploit/exploit.py --host=jmcp-vuln
  63. # exit 1 on confirmed unauthenticated management access, 0 on a safe target
  64. ```
  65. ## 5. Expected results
  66. | route (no auth) | `jmcp-vuln` (1.0.2) | `jmcp-fixed` (1.0.3) |
  67. | --- | --- | --- |
  68. | `PUT /api/connect` | **handler runs, context reset (HTTP 500 from kernel connect)** | **401** before handler |
  69. | `DELETE /api/stop` | 200, reachable | 401 |
  70. | `GET /api/healthz` | 200 (public by design) | 200 (public by design) |
  71. Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,
  72. `evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,
  73. `evidence/exploit-standalone-run.txt`, `evidence/versions.txt`,
  74. `evidence/0day-sweep.txt`.
  75. ## 6. Environment preconditions
  76. * Podman (or Docker); bounded containers on the isolated `cve77318lab`
  77. network.
  78. * Outbound HTTPS at build time (GitHub tags; PyPI).
  79. * The PoC sends `Host: localhost:4040` so the fixed build's local-Host check
  80. passes and the differential isolates the token enforcement.
  81. ## 7. Additional findings (0-day sweep on the fixed line)
  82. The probe matrix on 1.0.3 returns 401 for both authenticated management
  83. routes; `healthz` stays public by design on both builds. No unauthenticated
  84. path to `set_config` / `ServerContext.reset` remains after the fix.
  85. ## 8. Repository layout
  86. ```
  87. README.md this write-up
  88. run-lab.sh environment driver (build / up / sweep / down)
  89. Makefile convenience targets
  90. poc/poc.py the PoC (check / exploit / probe / mitigation)
  91. exploit/exploit.py standalone full-chain exploit
  92. lab/lab.Dockerfile pip-installs both upstream tags
  93. lab/supervisor.py child-process server supervisor + /status
  94. evidence/ captured runs of every mode on both sides
  95. TRACKING.md excluded (working record)
  96. ```
  97. ## 9. References
  98. * CVE record — https://www.cve.org/CVERecord?id=CVE-2026-77318
  99. * GitHub advisory — https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-24pw-rf5p-mgp7
  100. * Vendor fix commit — https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4d246fc5
  101. * Fixed release — https://github.com/datalayer/jupyter-mcp-server/releases/tag/v1.0.3

Ratings and comments

Sign in to rate this skill.

Sign in

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