Back to search
CVE-2026-77318
MCP serverGitHub
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
Markdown
[](/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
- # CVE-2026-77318 — Jupyter MCP Server: unauthenticated management routes hijack the Jupyter backend
- [](LICENSE)
- [](#5-expected-results)
- | | |
- | --- | --- |
- | **CVE** | CVE-2026-77318 |
- | **Component** | datalayer/jupyter-mcp-server — standalone `streamable-http` management routes (`server.py`) |
- | **Affected** | `< 1.0.3` |
- | **Fixed in** | **1.0.3** — genuine vendor fix, commit `c2e98fca` (PR #262) |
- | **CWE** | CWE-306 (Missing Authentication for Critical Function) |
- | **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` |
- | **Vector** | Network — management routes mounted on the same Starlette app as `/mcp` |
- | **Trigger** | `PUT /api/connect` with no `Authorization` header |
- In standalone `streamable-http` mode the `/mcp` endpoint enforces
- `MCP_TOKEN`, but the custom management routes (`/api/connect`, `/api/stop`)
- were mounted without that enforcement. The fix adds
- `ManagementRouteSecurityMiddleware`:
- ```python
- # v1.0.3 — management routes now require a Bearer token
- if self._token_verifier and _is_authenticated_management_route(path):
- scheme, _, token = request.headers.get("authorization", "").partition(" ")
- if scheme.lower() != "bearer" or not token:
- return JSONResponse({"error": "invalid_token"}, status_code=401)
- ```
- ---
- ## 1. Root cause
- Authentication was applied at the MCP transport layer (`/mcp`) but not to
- the auxiliary management routes that mutate the same server configuration
- singleton. `connect` calls `set_config(...)` and `ServerContext.reset()`,
- then starts a kernel client against the supplied URLs — so an unauthenticated
- request redirects the whole server to an attacker backend. The fix moves the
- token check into middleware covering the management routes, plus local
- Host/Origin checks to block browser-based abuse.
- ## 2. Reproduction environment
- | service | image | role |
- | --- | --- | --- |
- | `jmcp-vuln` | `cve-2026-77318:vuln` | jupyter-mcp-server **v1.0.2** |
- | `jmcp-fixed` | `cve-2026-77318:fixed` | jupyter-mcp-server **v1.0.3** (vendor fix) |
- | `poc` | `cve-2026-77318-poc:local` | stdlib-only Python driver |
- Both run with `MCP_TOKEN=lab-secret-token --transport streamable-http
- --port 4040`. A supervisor exposes `/status` (server log tail) and
- `/restart` on :8081 so each probe starts from a clean log. Dependency pins
- (`jupyter-kernel-client==0.9.0`, `mcp<2`) are required to run the v1.0.x
- code against current PyPI releases.
- ## 3. Running the environment
- ```sh
- ./run-lab.sh build # pip-installs both upstream tags
- ./run-lab.sh up # cve77318lab network: jmcp-vuln / jmcp-fixed
- ./run-lab.sh sweep # check / exploit / probe / mitigation on both sides
- ./run-lab.sh down
- ```
- ## 4. The PoC
- `poc/poc.py` (stdlib only):
- * **check** — `PUT /api/connect` without a token; exit 1 when the handler
- runs (log marker / non-401), 0 on 401; 3 no worker, 2 unreachable.
- * **exploit** — narrated stages with the server log line proving the
- context reset.
- * **probe** — connect / stop / healthz matrix.
- * **mitigation** — 1.0.3 / commit `c2e98fca`.
- A standalone full-chain exploit ships at `exploit/exploit.py`:
- ```sh
- python3 exploit/exploit.py --host=jmcp-vuln
- # exit 1 on confirmed unauthenticated management access, 0 on a safe target
- ```
- ## 5. Expected results
- | route (no auth) | `jmcp-vuln` (1.0.2) | `jmcp-fixed` (1.0.3) |
- | --- | --- | --- |
- | `PUT /api/connect` | **handler runs, context reset (HTTP 500 from kernel connect)** | **401** before handler |
- | `DELETE /api/stop` | 200, reachable | 401 |
- | `GET /api/healthz` | 200 (public by design) | 200 (public by design) |
- Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,
- `evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,
- `evidence/exploit-standalone-run.txt`, `evidence/versions.txt`,
- `evidence/0day-sweep.txt`.
- ## 6. Environment preconditions
- * Podman (or Docker); bounded containers on the isolated `cve77318lab`
- network.
- * Outbound HTTPS at build time (GitHub tags; PyPI).
- * The PoC sends `Host: localhost:4040` so the fixed build's local-Host check
- passes and the differential isolates the token enforcement.
- ## 7. Additional findings (0-day sweep on the fixed line)
- The probe matrix on 1.0.3 returns 401 for both authenticated management
- routes; `healthz` stays public by design on both builds. No unauthenticated
- path to `set_config` / `ServerContext.reset` remains after the fix.
- ## 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 pip-installs both upstream tags
- lab/supervisor.py child-process server supervisor + /status
- 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-77318
- * GitHub advisory — https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-24pw-rf5p-mgp7
- * Vendor fix commit — https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4d246fc5
- * Fixed release — https://github.com/datalayer/jupyter-mcp-server/releases/tag/v1.0.3
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.