# CVE-2026-134817 — mcp-server-kubernetes: kubectl flag injection through positional operands
[ |
| **Fixed in** | **4.2.0** — commit `588d4949` (GHSA-8v48-c263-r637) |
| **CWE** | CWE-88 (Improper Neutralization of Argument Delimiters) |
| **Impact** | Remote MCP clients could supply dash-prefixed values as positional operands to tools such as `exec_in_pod`, `kubectl_patch` and `kubectl_logs`. The values reached `kubectl` verbatim and were parsed as flags — for example `--filename` made kubectl read files from the server host, bypassing file-read restrictions. The flaw is reachable over SSE and Streamable HTTP transports |
| **Vector** | MCP tool call with a dash-prefixed resource name |
| **Trigger** | `kubectl_logs({name: "--filename=/etc/passwd"})` |
args = ['logs', input.name, '-n', namespace] # no dash-prefix check
// fixed (commit 588d4949, verbatim in the lab)
if (typeof value !== "string" || !value.startsWith("-")) return;
throw new McpError(ErrorCode.InvalidParams, `Refusing to run kubectl/helm with ${field}="${value}" ...`);
CLI tools parse any argument beginning with `-` as a flag, regardless of the
caller's intent to use it as a positional operand. mcp-server-kubernetes
forwarded resource names and types directly into `kubectl` argv without
rejecting dash-prefixed values, so an MCP client could select arbitrary flags
— including file-reading options — on the server. The fix applies a single
`assertNotFlagLike()` validator to every positional operand across the
| `mk-vuln` | `cve-2026-134817:vuln` | no operand guard |
| `mk-fixed` | `cve-2026-134817:fixed` | verbatim `assertNotFlagLike()` from `588d4949` |
| `poc` | `cve-2026-134817-poc:local` | stdlib-only Python driver |
The Go-free Node harness embeds the verbatim validator with minimal MCP error
stubs and models the `kubectl_logs` argv construction.
./run-lab.sh build # builds both sides (node:22-alpine)
./run-lab.sh up # cve134817lab network: mk-vuln / mk-fixed
* **check** — exit 1 when a dash-prefixed operand reaches kubectl argv, 0
when the guard rejects it; 3 no worker, 2 unreachable.
* **exploit** — narrated chain: MCP client operand → unverified argv →
* **probe** — malicious and benign resource names.
* **mitigation** — 4.2.0 / commit `588d4949` / `assertNotFlagLike()`.
A standalone full-chain exploit ships at `exploit/exploit.py`:
python3 exploit/exploit.py --host=mk-vuln
# exit 1 on confirmed flag injection, 0 on a safe target
| resource name | `mk-vuln` (< 4.2.0) | `mk-fixed` (4.2.0) |
| `--filename=/etc/passwd` | **argv `['logs', '--filename=/etc/passwd', '-n', 'default']`** | **`McpError: Refusing to run kubectl/helm ...`** |
| `my-pod` (control) | valid argv | valid argv |
Captured runs: `evidence/check-*-run.txt`, `evidence/exploit-*-run.txt`,
`evidence/probe-*-run.txt`, `evidence/mitigation-*-run.txt`,
`evidence/exploit-standalone-run.txt`, `evidence/exploit-standalone-fixed-run.txt`,
`evidence/versions.txt`, `evidence/0day-sweep.txt`.
* Podman (or Docker); bounded containers on the isolated `cve134817lab`
* Real-world exploitation requires MCP access to an affected server via SSE
or Streamable HTTP; no Kubernetes credentials are required to reach the
## 7. Additional findings (0-day sweep on the fixed line)
`assertNotFlagLike()` is applied to positional operands across `exec_in_pod`,
`kubectl_patch`, `kubectl_logs`, `kubectl_create` and port-forward handling —
the tools named in the advisory. Ordinary resource names still build valid
kubectl argv on the fixed build, so normal tool behavior is preserved.
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/harness-*.js verbatim validator + argv model
lab/lab.Dockerfile builds both sides from pinned upstream source slices
lab/service.js HTTP wrapper (POST /logs), child-process isolation
evidence/ captured runs of every mode on both sides
TRACKING.md excluded (working record)
* CVE record —
* GitHub advisory —
* Fix commit —
* Fixed release — mcp-server-kubernetes 4.2.0
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
