CVE-2026-129236: Command-Line Argument Injection in Kubeshark MCP Server
Vulnerability ID: CVE-2026-129236
CVSS Score: 7.2
Published: 2026-11-16
CVE-2026-129236 is a command-line argument injection vulnerability (CWE-88) in Kubeshark, an eBPF-based network observability tool for Kubernetes. Located within the Model Context Protocol (MCP) server implementation in cmd/mcpRunner.go, the flaw occurs when handling the start_kubeshark tool request. When the MCP server runs with the --allow-destructive flag, the callStartKubeshark function appends the caller-supplied pod_regex parameter directly to the kubeshark tap argument slice without an end-of-options (--) delimiter. Because Kubeshark uses the Cobra and pflag libraries for command-line parsing, any pod_regex value prefixed with a hyphen is interpreted as a CLI flag rather than a positional regular expression. An attacker capable of influencing MCP tool arguments, such as through indirect prompt injection against a connected Large Language Model (LLM) agent, can inject the --set flag to override Helm chart values like tap.docker.registry. Because Kubeshark deploys its worker DaemonSet with privileged security contexts and host networking enabled, redirecting the container image registry allows arbitrary code execution as root across all Kubernetes cluster nodes.
TL;DR
A command-line argument injection flaw (CWE-88) in Kubeshark versions 53.1.0 through 53.3.0 allows attackers to pass arbitrary CLI flags via the pod_regex parameter in the start_kubeshark MCP tool. When the MCP server runs with --allow-destructive, injecting --set flags overrides the container image registry for Kubeshark's privileged worker DaemonSet, resulting in root-level code execution across Kubernetes cluster nodes.
⚠️ Exploit Status: POC
Technical Details
- Vulnerability Type: CWE-88: Argument Injection
- CVSS v3.1 Score: 7.2 High (AV:L/AC:H/PR:H/UI:R/S:C/C:H/I:H/A:H)
- Affected Component: cmd/mcpRunner.go (callStartKubeshark)
- Affected Versions: >= 53.1.0, < 53.4.0
- Patched Version: v53.4.0
- Prerequisite Flag: kubeshark mcp --allow-destructive
- Cluster Impact: Privileged DaemonSet Execution / Node Root Compromise
- CISA KEV Status: Not Listed
Affected Systems
- Kubeshark CLI (github.com/kubeshark/kubeshark) subcommand 'kubeshark mcp'
-
Kubeshark: >= 53.1.0, < 53.4.0 (Fixed in:
53.4.0)
Code Analysis
Commit: a76a192
mcp: confine download_file destination and harden start_kubeshark argument handling (#1957)
diff --git a/cmd/mcpRunner.go b/cmd/mcpRunner.go
index 42b23b9170..c439939ac3 100644
--- a/cmd/mcpRunner.go
+++ b/cmd/mcpRunner.go
@@ -940,11 +940,14 @@ func (s *mcpServer) callStartKubeshark(args map[string]any) (string, bool) {
// Build the kubeshark tap command
cmdArgs := []string{"tap"}
- // Add pod regex if provided
- if v, ok := args["pod_regex"].(string); ok && v != "" {
- cmdArgs = append(cmdArgs, v)
- }
+ // Capture the caller-supplied pod regex. It is appended LAST, after a "--"
+ // end-of-options separator (see below), so a value beginning with "-"
+ // (e.g. "--set=tap.docker.registry=...") can never be parsed as a flag by
+ // the 'tap' cobra command. See CWE-88 (argument injection).
+ podRegex, _ := args["pod_regex"].(string)
// Add namespaces if provided
if v, ok := args["namespaces"].(string); ok && v != "" {
@@ -955,6 +1025,13 @@ func (s *mcpServer) callStartKubeshark(args map[string]any) (string, bool) {
// Execute the command in headless mode (no browser popup)
cmdArgs = append(cmdArgs, "--set", "headless=true")
+ // Append the pod regex as a positional argument, guarded by "--" so it is
+ // always treated as the [POD REGEX] operand and never as a flag (CWE-88).
+ // This must come after every flag above.
+ if podRegex != "" {
+ cmdArgs = append(cmdArgs, "--", podRegex)
+ }
+
// Log progress to stderr (MCP clients can see this in their logs)
logProgress := func(msg string) {
_, _ = fmt.Fprintf(os.Stderr, "[kubeshark-mcp] %s\n", msg)
Exploit Details
- GitHub Security Advisory: Official advisory detailing the '--set=tap.docker.registry=...' argument injection proof-of-concept via the start_kubeshark MCP tool.
Mitigation Strategies
- Upgrade Kubeshark CLI to v53.4.0 or later to ensure positional arguments in MCP tools are delimited with '--'.
- Run the Kubeshark MCP server without the '--allow-destructive' flag to disable the 'start_kubeshark' and 'stop_kubeshark' tools.
- Require explicit human-in-the-loop confirmation in MCP clients before executing administrative or cluster-modifying tools.
- Implement Kubernetes admission control policies (Kyverno or OPA Gatekeeper) to restrict container images to approved internal or official Kubeshark registries.
Remediation Steps:
- Identify all developer workstations, CI/CD runners, and AI agent hosts running the 'kubeshark' binary between versions 53.1.0 and 53.3.0.
- Inspect MCP client configurations for invocations of 'kubeshark mcp --allow-destructive' and remove the '--allow-destructive' flag if lifecycle management is not strictly required.
- Download and install Kubeshark v53.4.0 or later from the official GitHub releases page.
- Audit Kubernetes cluster events and DaemonSet manifests in the Kubeshark release namespace to verify that no unauthorized 'tap.docker.registry' overrides have been deployed.
References
- GitHub Security Advisory GHSA-8vf2-hxg5-crqh
- Kubeshark Pull Request #1957
- Kubeshark Pull Request #1957 Patch File
- GitHub Fix Commit a76a1920dc7587be700a17f1592f58a9512ad214
- Kubeshark Release v53.4.0
- CVE-2026-129236 Record on CVE.org
- NVD Vulnerability Detail for CVE-2026-129236
- MITRE ATT&CK Search for CVE-2026-129236
Read the full report for CVE-2026-129236 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)