MCP Server Kubernetes has Argument Injection in its port_forward tool via space-splitting
Key facts
- Attack vector
- Network
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-88.
Summary
mcp-server-kubernetes is a Model Context Protocol server for Kubernetes cluster management. Versions 3.4.0 and prior contain an argument injection vulnerability in the port_forward tool in src/tools/port_forward.ts, where a kubectl command is constructed via string concatenation with user-controlled input and then naively split on spaces before being passed to spawn(). Unlike all other tools in the codebase which correctly use array-based argument passing with execFileSync(), port_forward treats every space in user-controlled fields (namespace, resourceType, resourceName, localPort, targetPort) as an argument boundary, allowing an attacker to inject arbitrary kubectl flags. This enables exposure of internal Kubernetes services to the network by injecting --address=0.0.0.0, cross-namespace targeting by injecting additional -n flags, and indirect exploitation via prompt injection against AI agents connected to the MCP server. This issue has been fixed in version 3.5.0.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Flux159 | mcp-server-kubernetes | before 3.5.0 | 3.5.0 | Patch available | CNA |
| — | mcp-server-kubernetes (npm) | before 3.5.0 | 3.5.0 | Patch available | GHSA-4xqg-gf5c-ghwq |
- mcp-server-kubernetes VendorFlux159 Affected before 3.5.0 Fixed in 3.5.0 Patch available CNA
- mcp-server-kubernetes (npm) Vendor— Affected before 3.5.0 Fixed in 3.5.0 Patch available GHSA-4xqg-gf5c-ghwq
Remediation
- Fix · CNA mcp-server-kubernetes (Flux159) Fixed in 3.5.0
- Fix · GHSA-4xqg-gf5c-ghwq mcp-server-kubernetes (npm) Fixed in 3.5.0 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-39884
- 2026-10-03 Alias added: GHSA-4xqg-gf5c-ghwq
References
More Flux159 Mcp-server-kubernetes vulnerabilities
- TI-2026-44064 MCP Server Kubernetes < 3.9.0 Argument Injection via kubectl Structured Tools CVSS 4.0CRITICAL 9.3
- TI-2025-40841 mcp-server-kubernetes potential security issue in exec_in_pod tool CVSS 3.1HIGH 8.8
Sources
- CVE-2026-39884 · CVE Program
- CVE-2026-39884 · NVD
- FIRST EPSS
- GHSA-4xqg-gf5c-ghwq · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences