NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · Other MCP servers and tools

CVE-2025-59377: mcp-kubernetes-server has an OS Command Injection vulnerability

criticalCVSS 3.1 9.8GHSA-4hqq-7q79-932p

mcp-kubernetes-server (feiskyer) up to 0.1.11 has an OS command injection in its kubectl tool. The server builds a shell string and runs it with shell=True, so an unauthenticated caller can append commands with ; or &&. This works even in read-only mode. No patched version exists yet.

Published Sep 15, 2025 · Updated Sep 25, 2025 · Analysis Nov 1, 2026

What an attacker can do

The kubectl tool takes a command string, prepends kubectl and runs it through subprocess with shell=True (command.py). The only validation checks that the first token is kubectl. Anything after a metacharacter such as ;, && or $() runs as a shell command with the server privileges.

The public write-up shows the HTTP streamable transport at port 8000, path /mcp/, with a JSON-RPC tool call whose command is a harmless kubectl call followed by ; and a second command. The reporter wrote output of id to a file under /tmp as proof. The same trick bypasses --disable-write and --disable-delete: a permitted kubectl command chained with a forbidden delete or scale ran against servers started with those flags.

An attacker with network access to the endpoint gets code execution on the host plus the kubeconfig and cluster credentials it holds, which allows pivoting into the cluster. A second route needs no network access: the write-up describes prompt injection through pod logs, where an LLM client reads attacker text and sends the chained payload. The CVSS vector is network, no privileges, no interaction.

Who is affected

Affected: mcp-kubernetes-server 0.1.11 and earlier, installed from PyPI. The risk is highest when it runs with the HTTP transport on a reachable address. Stdio use is still exposed to prompt-injected agents. Check the version:

pip show mcp-kubernetes-server

Also check the process list for the server and its flags, such as --transport streamable-http, --host and --disable-write.

mcp-kubernetes-server

Ecosystem
PyPI
Affected
<= 0.1.11
Fixed in
No patched version yet
Check
pip show mcp-kubernetes-server

How to fix it

There is no patched version. The packages data lists none, and the write-up shows no fix commit or release. Do not rely on --disable-write or --disable-delete, because chained commands bypass them.

Mitigations from the sources: avoid the HTTP transport or bind it to localhost behind authentication, run the server as a low-privilege user with a narrowly scoped kubeconfig and RBAC role, and keep untrusted pod logs away from the agent. The reporter recommends the code fix: drop shell=True, pass arguments as a list to subprocess.run, and validate against an allow-list of kubectl subcommands and flags. Watch the repository for a release.

How to tell if you were hit

Search web or MCP logs for kubectl tool calls whose command contains ;, &&, |, backticks or $(. Look for files created under /tmp by the server user, and for child processes of the server other than kubectl, such as sh, curl, nc or id. Review Kubernetes audit logs for deletes or scale changes from the server service account while the server was set to read-only. Beam records agent shell commands and MCP tool calls, so its rules can flag chained kubectl commands.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

feiskyer/mcp-kubernetes-server through 0.1.11 allows OS command injection via the /mcp/kubectl endpoint. The handler constructs a shell command with user-supplied arguments and executes it with subprocess using shell=True, enabling injection through shell metacharacters (e.g., ;, &&, $()), even when the server is running in read-only mode.

A remote, unauthenticated attacker can execute arbitrary OS commands on the host, resulting in full compromise of confidentiality, integrity, and availability.

This issue is distinct from mcp-server-kubernetes and from CVE-2025-53355.

Credited to cai0duque.

Questions

Is there a fix for CVE-2025-59377?

Not as of the sources. The advisory lists versions up to 0.1.11 as affected and names no patched release, and the write-up links no fix.

Does read-only mode protect me?

No. The advisory says the injection works in read-only mode, and the write-up shows chained delete and scale commands passing when --disable-delete or --disable-write was set.

Does an attacker need credentials?

The advisory says a remote, unauthenticated attacker can exploit it. The endpoint has no authentication of its own, so network reachability is the main condition.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More Other MCP servers and tools vulnerabilities

All Other MCP servers and tools entries