CVE-2026-129235: Arbitrary File Write and Argument Injection in Kubeshark MCP Server
Vulnerability ID: CVE-2026-129235
CVSS Score: 5.3
Published: 2026-11-16
Kubeshark versions 53.1.0 prior to 53.4.0 contain an arbitrary file write and path traversal vulnerability (CWE-22) alongside an argument injection vulnerability (CWE-88) in the Model Context Protocol (MCP) server implementation (cmd/mcpRunner.go). The download_file tool fails to validate caller-supplied path and dest arguments, allowing an attacker who influences an AI agent driving kubeshark mcp to write Kubeshark Hub API responses to arbitrary locations writable by the local user. Additionally, the start_kubeshark tool appends the pod_regex argument without flag delimiters, allowing argument injection into the kubeshark tap subcommand.
TL;DR
An unvalidated destination path in Kubeshark's MCP server download_file tool allows attackers to overwrite arbitrary local files with Hub API response bytes and traverse Hub API paths via indirect prompt injection against connected AI agents. Version 53.4.0 fixes the path traversal and an associated argument injection in start_kubeshark.
⚠️ Exploit Status: POC
Technical Details
- Vulnerability ID: CVE-2026-129235 / GHSA-gj7r-p794-hhq5
- CWE Classification: CWE-22 (Path Traversal) & CWE-88 (Argument Injection)
- CVSS v3.1 Score: 5.3 Medium (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N)
- Affected Component: cmd/mcpRunner.go (download_file and start_kubeshark MCP tools)
- Affected Versions: >= 53.1.0, < 53.4.0
- Patched Version: 53.4.0
- Exploit Status: Proof-of-Concept unit tests in official commit
- CISA KEV Status: Not Listed
Affected Systems
- Kubeshark CLI and Model Context Protocol (MCP) Server (github.com/kubeshark/kubeshark)
-
Kubeshark: >= 53.1.0, < 53.4.0 (Fixed in:
53.4.0)
Code Analysis
Commit: a76a192
Confines download_file destinations to downloadDir with symlink and O_NOFOLLOW checks, blocks '..' in Hub API paths, and adds '--' before pod_regex in start_kubeshark.
+if hasDotDotSegment(filePath) {
+ return "Error: 'path' must not contain '..' segments", true
+}
+dest, err := secureDownloadDest(s.downloadDir, destArg, filePath)
+outFile, err := createNoFollow(dest)
+
+if podRegex != "" {
+ cmdArgs = append(cmdArgs, "--", podRegex)
+}
Exploit Details
- GitHub: Official patch commit containing unit test PoCs in cmd/mcp_test.go demonstrating path traversal, symlink escape, and argument injection.
Mitigation Strategies
- Upgrade Kubeshark CLI and cluster components to version 53.4.0 or later to enforce directory confinement and argument delimiters.
- Isolate MCP file writes by configuring the KUBESHARK_MCP_DOWNLOAD_DIR environment variable to a dedicated, empty sandbox directory.
- Enable authentication on the Kubeshark Hub deployment (tap.auth.enabled=true) to prevent unauthorized reading of captured PCAP and API traffic.
- Require explicit human-in-the-loop approval within MCP client configurations (such as Claude Desktop or Cursor) before executing Kubeshark MCP tool calls.
Remediation Steps:
- Download the patched Kubeshark v53.4.0 binary from https://github.com/kubeshark/kubeshark/releases/tag/v53.4.0 and replace existing CLI installations.
- Create a restricted directory with 0700 permissions and set KUBESHARK_MCP_DOWNLOAD_DIR in the MCP server's execution environment.
- Update Helm chart values or CLI tap arguments to set tap.auth.enabled=true and redeploy Kubeshark cluster resources.
References
- GitHub Security Advisory GHSA-gj7r-p794-hhq5
- Kubeshark Fix Commit a76a1920dc7587be700a17f1592f58a9512ad214
- Kubeshark Pull Request #1957
- Kubeshark Release v53.4.0
- CVE-2026-129235 Record on CVE.org
- NVD Entry for CVE-2026-129235
- CVE JSON Record in CVEProject/cvelistV5
Read the full report for CVE-2026-129235 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)