CVE-2025-66404: mcp-server-kubernetes Command Injection Vulnerability
Summary
CVE-2025-66404: mcp-server-kubernetes has potential security issue in exec_in_pod tool. Affects mcp-server-kubernetes versions < 2.9.8. Fixed in 2.9.8. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
mcp-server-kubernetes is an open-source MCP Server that facilitates the execution of commands within Kubernetes pods. It allows users to interact with Kubernetes resources and manage them effectively. However, the exec_in_pod tool within this package has a significant security flaw that can lead to command injection attacks, compromising the integrity and security of the Kubernetes environment.
Vulnerability Detail
The vulnerability arises from the exec_in_pod tool's handling of user-provided commands. When commands are provided in string format, they are executed directly by the shell without any input validation. This allows attackers to inject malicious commands using shell metacharacters, leading to potential unauthorized access and manipulation of sensitive data within Kubernetes pods. The vulnerability can be exploited through direct command injection or indirect prompt injection, where AI agents may execute unintended commands based on manipulated input.
How To Fix
Latest published version: 4.1.9 as of 23 Oct 2026
npm install mcp-server-kubernetes@4.1.9
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
2.9.8
This is the first release that contains the fix.
npm install mcp-server-kubernetes@2.9.8
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, avoid using the string format for commands in the exec_in_pod tool. Instead, always provide commands as an array of strings to prevent shell interpretation. For example, use the following format:
execInPod(k8sManager, { name: 'test-pod', command: ['id'] });
Conclusion
The CVE-2025-66404 vulnerability in the mcp-server-kubernetes package poses a significant risk due to command injection possibilities. It is crucial to update to the patched version to mitigate this risk and ensure the security of your Kubernetes environment.
See every vulnerability recorded for mcp-server-kubernetes →
FAQ
CVE-2025-66404 is a security vulnerability in the mcp-server-kubernetes package that allows for command injection through the exec_in_pod tool.
Attackers can exploit this vulnerability by injecting malicious commands using shell metacharacters when executing commands in string format.
The impacts include unauthorized command execution, access to sensitive data, and modification of pod states within Kubernetes.
Yes, the vulnerability is patched in version 2.9.8 of the mcp-server-kubernetes package.
You can use Vulert, which monitors open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected by this vulnerability.
References
Related vulnerabilities
Recent vulnerabilities recorded for mcp-server-kubernetes.