What happened
mcp-server-kubernetes before 4.2.0 passes dash-prefixed positional operands into kubectl commands in tools such as exec_in_pod, kubectl_patch and kubectl_logs. A remote MCP client over SSE or Streamable HTTP can inject flags such as --filename to make kubectl read server-host files, bypassing file-read restrictions. CVSS 7.1 (CVSS 3.1).
Why it matters
This MCP server is a privileged bridge between an LLM agent and a Kubernetes cluster's CLI. Flag injection lets a remote (or prompt-injected) agent abuse kubectl's own options to read files on the server host and affect resources beyond what the tool's parameter schema permits, broadening an agent's reach from cluster objects to the host filesystem.
Attack vector
Remote MCP client sends dash-prefixed values as positional operands to exec_in_pod / kubectl_patch / kubectl_logs to inject kubectl flags.
Affected systems
Flux159/mcp-server-kubernetes < 4.2.0
Mitigation
Upgrade to v4.2.0 (fix PR #390); validate/reject leading-dash operands before passing to kubectl.