CVE-2026-134817: mcp-server-kubernetes let MCP clients pass dash-prefixed names like --filename=<path> to kubectl through tools such as exec_in_pod, kubectl_patch and kubectl_logs, reading files from the server host (fixed 4.2.0)
mcp-server-kubernetes (Flux159) is a popular MCP server that lets AI agents run kubectl against a cluster. Before 4.2.0, several tools put caller-supplied values straight into kubectl's positional operand slots. kubectl's flag parser treats any dash-prefixed token as a flag wherever it appears, so a resource or pod name like --filename=<path> was parsed as a flag, making kubectl read files from the machine running the MCP server and bypassing the server's own file-read restrictions. Clients connected over the SSE or Streamable HTTP transports could do this, and so can a prompt-injected agent. Fixed in 4.2.0.
What it is
Affected tools (per PR #390): exec_in_pod (name), kubectl_patch (resourceType, name), kubectl_rollout (subCommand, resourceType, name), kubectl_logs (name), kubectl_create (name, secretType, serviceType), explain_resource (resource), node_management (nodeName) and port_forward (resourceType).
An earlier change (#369) had already added the flag-shaped operand check to kubectl_get, kubectl_describe, kubectl_delete, kubectl_scale and kubectl_generic; these remaining tools were missing it.
v4.2.0 (released 26 October 2026) bundles the fix with other kubectl argument hardening: a verb policy for kubectl_generic, fail-closed argv checks, kubectl_create input validation, private temp files, and kubectl_context set disabled in read-only mode.
NVD published the CVE (CNA VulnCheck, CWE-88 argument injection) on 22 November 2026.
How to check
- Check the installed version: anything below 4.2.0 is affected (npx mcp-server-kubernetes, or the version pinned in your MCP client config).
- Pay most attention to deployments exposed over SSE or Streamable HTTP rather than local stdio.
- Review MCP tool-call logs for operands that start with a dash (for example --filename, -f, --kubeconfig).
How to fix
- Upgrade mcp-server-kubernetes to 4.2.0 or later.
- Run it with a least-privilege kubeconfig and in read-only mode where agents only need to inspect the cluster.
- Don't expose the HTTP transports beyond localhost without authentication, and don't let an agent with this server process untrusted content.
npm ls -g mcp-server-kubernetes
# or check the version pinned in your MCP client config, then pin:
npx -y [email protected] Sources
- criticalCVE-2026-61459: MCP Server Kubernetes flag injection in kubectl tools can send the cluster bearer token to an attacker server (fixed 3.9.0)
- highCVE-2026-102735: mcp-server-kubernetes's SSE transport did not check the Host header, leaving it open to DNS rebinding from a malicious website (fixed 4.0.8)