Local MCP server: DNS rebinding and argument injection
Why can a “local” MCP server still be attacked?
Because a service listening on a port is reachable by anything that can send it a request, and the user’s browser is one of those things. An MCP server started in HTTP mode does not protect its routes merely by running on the developer’s machine. A malicious web page visited at the wrong moment, or an unintended network exposure, is enough.
Two CVEs published in November 2026 show it through different paths. The first goes through the browser (DNS rebinding), the second through the content of the arguments an MCP client sends to a tool. They share neither cause nor fix, but they ask the same question: who can talk to this server, and what can they make it do?
How does the DNS rebinding attack on Jupyter MCP Server work?
The server checks the Host and Origin headers on /mcp; its custom management routes /api/connect and /api/stop have no equivalent check. In streamable-http mode, a malicious page can therefore reach those routes from the victim’s browser through DNS rebinding. The principle of rebinding: the page keeps the attacker’s origin while its hostname starts resolving to the address of the local server. The browser then sends requests carrying the attacker’s Host and Origin to a service that has no reason to refuse them.
According to the GitHub advisory (GHSA-9x8x-crjq-g64h), PUT /api/connect replaces the active Jupyter backend (URLs and tokens) and starts a kernel client against that backend. The attacker can thus redirect the server to infrastructure they control, which receives the server’s Jupyter API and WebSocket requests. DELETE /api/stop removes the current notebook kernel. The affected versions are 1.0.2 and earlier; 1.0.3 fixes the flaw.
| Item | CVE-2026-77359 | CVE-2026-77318 |
|---|---|---|
| Flaw | No Host/Origin check on management routes | MCP_TOKEN only protects /mcp |
| Weakness | CWE-350 | CWE-306 |
| Severity (CVSS v4) | 9.3 critical | 7.3 high |
| Affected versions | 1.0.2 and earlier | 1.0.2 and earlier |
| Fix | 1.0.3 | 1.0.3 |
Ostorlab’s analysis adds three points, to be read with the caution due to a single source: stdio mode is not affected; the server listened on all interfaces (0.0.0.0, port 4040) by default; and as of November 22, 2026, no exploitation in the wild was known for either CVE. The analysis also notes that the advisory does not demonstrate code execution on the MCP host. The impact is hijacking of the Jupyter backend and interruption of the kernel.
How does the second Jupyter CVE differ?
It targets authentication: the token that protects /mcp is not checked on the management routes, so a caller that reaches the port can change the backend. Setting MCP_TOKEN therefore did not close the gap before 1.0.3. The remedies the advisories recommend come down to four lines: check Host and Origin before parsing a request body or changing state; require the token on every route that reads or changes state; listen on 127.0.0.1 by default, with an explicit host allowlist for any other interface; add regression tests with forged browser headers.
If the upgrade has to wait, Ostorlab suggests restricting network access to the listener and, for a container, publishing the port on the loopback interface only. The upgrade requires a server restart: replacing the files without restarting is not enough.
What does the argument injection in mcp-server-kubernetes show?
That values supplied by a client can be interpreted as options when they start with a dash. In versions before 4.2.0, dash-prefixed values passed as positional operands were read by kubectl as flags. Over the SSE or Streamable HTTP transports, a value such as --filename makes kubectl read files from the server host and bypasses file-read restrictions. The tools named are exec_in_pod, kubectl_patch and kubectl_logs. The VulnCheck advisory classifies the flaw as CWE-88 (argument injection) with a CVSS score of 7.1, and credits Zachariah Mithani (AploSec).
The 4.2.0 fix is described in the release notes as hardening of kubectl argument handling: a verb policy for kubectl_generic, argv checks that fail closed, input validation for kubectl_create, and flag-shaped operand checks in the remaining tools. The VulnCheck advisory does not detail the fix mechanism.
This flaw concerns any MCP server that builds a command from tool parameters. The kubectl case is telling because the tool is powerful and the inputs come from an agent, which untrusted text can itself influence. Our article on command injection through MCP in LiteLLM illustrates a neighboring family.
How do you test a local MCP server?
On your own workstation or a staging environment, with these checks, in this order:
- Listening address: list open sockets (for example with lsof or ss) and verify that the server listens on the loopback interface only, unless a documented need says otherwise.
- Route inventory: list every route, including the ones other than /mcp. Health, management and configuration routes are the ones people forget to protect.
- Token: call each route with no token, with an invalid token, then with a valid one. Any route that changes state must refuse the first two cases.
- Host and Origin: send each route with an unexpected Host and an external Origin. A refusal is expected before the request body is read. A lab rebinding tool can confirm the behavior in a real browser.
- Arguments: for every parameter of every tool that builds a command, send values starting with a dash, a bare double dash, spaces and quotation marks. Observe whether the value is treated as data or as an option.
- Command construction: check in the code that the command is launched with an argument list and without a shell, that the subcommand is picked from an allowlist, and that the end-of-options separator is used when the tool supports it.
These checks fit our framework for testing MCP servers: tool inputs, server privileges, confirmations. For a third-party server, the vetting guide before installation covers the essentials.
Which habits should developers and operators keep?
- Treat the browser as a hostile client: any local HTTP service must check Host and Origin, and authenticate every route.
- Apply the same protection everywhere: a rule set on /mcp but forgotten on a side route is a flaw. Regression tests must cover every route.
- Never build a command from a raw string: validate, cap, and refuse values that look like options.
- Upgrade with a restart and record which version is really running.
- Reduce what the server can reach: a minimal service account limits the reach of a hijack.
How does CleanIssue test a local MCP server?
We treat the server as an exposed API: inventory of routes and transports, header and token checks, hostile inputs carried by the agent all the way down to command arguments, then a reproducible proof for each finding. The Agent Red Team Express (€1,900, 5 days, start within 48 hours of signing the quote and the authorization) covers one agent and its MCP tools, local servers included; several servers or an integration chain fall under the Custom Red Team, on quote. The first step is a free 30-minute discovery call.
Does your product ship an AI agent? CleanIssue tests what a stranger can make it do with the Agent Red Team Express (5 days, €1,900), or a custom red team for several agents and MCP servers. First step: a free 30-minute discovery call.
Related articles
Three adjacent analyses to keep exploring the same attack surface.
AWS MCP server flaws (Nov 2026): SSRF, denylist, file write
Three AWS MCP server flaws from November 2026: SSRF, a bypassed denylist and an arbitrary file write. Lessons and a method to test your own servers.
LiteLLM CVE-2026-42271: Command Injection via MCP
CVE-2026-42271 (CVSS 8.7): two LiteLLM MCP test endpoints run commands, exploited per CISA. Affected versions, Starlette chain, fixes and how to test.
MCP Tool Poisoning and Rug Pulls: How to Test Them
Poisoned MCP tool descriptions and server rug pulls: how to test for them, which defences to put in place, and what the MCP specification says.
Sources
- Ostorlab: Jupyter MCP Server hijack through DNS rebinding (CVE-2026-77359)
- GitHub: advisory GHSA-9x8x-crjq-g64h (CVE-2026-77359, Host/Origin)
- GitHub: advisory GHSA-24pw-rf5p-mgp7 (CVE-2026-77318, routes without token)
- VulnCheck: mcp-server-kubernetes before 4.2.0, argument injection (CVE-2026-134817)
- GitHub: mcp-server-kubernetes v4.2.0 release notes
Related services
If this topic maps to a real risk in your stack, these are the most relevant CleanIssue audits.