Summary
Kubeshark: MCP download_file writes fetched bytes to an unvalidated destination path
Ecosystem / package: Go, github.com/kubeshark/kubeshark (the kubeshark
CLI, kubeshark mcp subcommand)
Affected component: cmd/mcpRunner.go, MCP tool download_file
Affected versions: >= v53.1.0, < v53.4.0 (the flaw shipped with the
tool's first release; v53.3.0 was the last affected release)
Patched version: v53.4.0
Credit: novice-22 (Urim), via private coordinated disclosure.
The download_file MCP tool fetches a caller-supplied path from the Kubeshark
Hub API and writes the response body to a caller-supplied dest on the local
filesystem with no validation of dest. An attacker who can influence the MCP
tool arguments, e.g. via indirect prompt injection against an AI agent drivingkubeshark mcp, can write attacker-controlled bytes to an arbitrary path
writable by the user running the MCP server (e.g. ~/.ssh/authorized_keys,~/.kube/config, ~/.bashrc), and can request arbitrary Hub API endpoints.download_file is registered unconditionally (available in the default,
non---allow-destructive posture).
Introduced in
Commit eb7dc42b, "Add get_file_url and download_file MCP tools (#1853)",
2026-03-04, first released in v53.1.0 (v53.1.0~1). An earlier attempt
(dbfd17d9) was reverted (a46f05c4) before any release, so no tag before
v53.1.0 is affected.
Details
In callDownloadFile (cmd/mcpRunner.go), both path and dest come straight
from the tool arguments:
destwas passed directly toos.Create(dest)with no confinement, nofilepath.Clean, no base-directory containment, no rejection of absolute
paths or../traversal. Any path the process can write is reachable.pathwas concatenated onto the Hub API base URL with no allowlist, so any
Hub endpoint (including captured-traffic exports) is reachable.
Auth context (CWE-306 / CWE-200)
The tool originally issued the fetch with no authentication. The authentication
gap was addressed by the gated-Hub authentication refactor: the download now
forwards the operator's Hub credentials (ServiceAccount token / License-Key) and
rejects auth-required responses instead of writing a login page to disk. But
the Hub ships auth-disabled by default (community/dev), so on a defaultkubeshark tap the Hub API answers without authentication and captured traffic
(credentials/tokens/PII) can still be read and exfiltrated end-to-end. Enforcing
Hub auth by default is tracked separately (gated-auth workstream) and is not
part of this advisory's fix.
Proof of concept (reporter, abridged)
Following the tool's documented workflow on a default community install:export_snapshot_pcap → obtain a relative path → download_file with thatpath and an attacker-chosen dest. The reporter retrieved a captured-traffic
PCAP and recovered a planted canary Authorization: Bearer … credential from
it, and demonstrated writing the fetched bytes to an arbitrary local path.
Severity rationale
Kubeshark scores this 5.3 Medium, down from the reporter's 7.1, on two metrics:
AV:N→AV:L. The vulnerable component has no network listener the
attacker reaches.kubeshark mcpis a local stdio MCP server; the attacker's
input arrives as content an agent running on that host ingests and then
replays into a local tool call. The delivery of the poisoned content may cross
a network, but the attack surface being exploited is local to the machine.I:H→I:L. The write is confined to paths writable by the user runningkubeshark mcp(normally unprivileged), no system-file or other-user
modification. The attacker also controls where the bytes land, not what
they are: the body comes from a Hub API response, so the content is
constrained to what the Hub will emit. Reliable RCE was not demonstrated.A:L→A:N. Nothing in the issue degrades availability of the CLI, the
Hub, or the host; the originalA:Lis unsupported.
Kubeshark kept C:H: on a default community install the Hub API answers
unauthenticated, so captured traffic (credentials, tokens, PII) is genuinely
readable end-to-end. Kubeshark kept AC:H (the attacker must land an injection in
content the agent ingests and know the deployment layout), PR:N
(download_file is registered unconditionally, no --allow-destructive
needed), UI:R (an operator must be driving an agent againstkubeshark mcp), and S:U (the impact stays within the local user's
authorization scope).
Workarounds
- Run
kubeshark mcpas an unprivileged user in an isolated working directory. - Do not expose the MCP server to untrusted content / untrusted agent inputs.
- Enable Hub authentication (
AUTH_ENABLED=true+ an IdP/license) to close the
unauthenticated read path.
Follow-ups (not blocking this advisory)
- Strict prefix allowlist for the Hub
path(current fix only rejects..). - Hub-side default auth enforcement (gated-auth workstream).
Impact
- Integrity (local): arbitrary file write on the machine running
kubeshark mcp, as that user. - Confidentiality: read of Hub API endpoints, incl. captured network traffic
(credentials, tokens, PII) on a default (auth-disabled) install. - Reliable RCE is not demonstrated (script endpoints are JSON-wrapped).
Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.
CVE-2026-129235 has a CVSS score of 5.3 (Medium). The vector is requires local access, no privileges required, and user interaction required. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.0.2-0.20260812200004-a76a1920dc75); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Fixed in v53.4.0 by commita76a1920
(PR #1957).
Changes in cmd/mcpRunner.go:
destis resolved throughsecureDownloadDestand confined to a base
directory (the CWD by default, relocatable viaKUBESHARK_MCP_DOWNLOAD_DIR);
adestthat resolves outside the base (via../or an absolute path) is
rejected.pathis rejected if it contains..segments.- Containment is re-checked after resolving symlinks, so a symlinked
subdirectory inside the base (or adestthat is itself a symlink) cannot
redirect the write outside it; the file is opened withO_NOFOLLOWwhere the
platform provides it. - Credential forwarding + auth-required detection on the fetch (shipped in the
gated-auth refactor).
Frequently Asked Questions
- What is CVE-2026-129235? CVE-2026-129235 is a medium-severity path traversal vulnerability in github.com/kubeshark/kubeshark (go), affecting versions >= 0.0.2-0.20260304171723-eb7dc42b6ea0, < 0.0.2-0.20260812200004-a76a1920dc75. It is fixed in 0.0.2-0.20260812200004-a76a1920dc75. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.
- How severe is CVE-2026-129235? CVE-2026-129235 has a CVSS score of 5.3 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/kubeshark/kubeshark are affected by CVE-2026-129235? github.com/kubeshark/kubeshark (go) versions >= 0.0.2-0.20260304171723-eb7dc42b6ea0, < 0.0.2-0.20260812200004-a76a1920dc75 is affected.
- Is there a fix for CVE-2026-129235? Yes. CVE-2026-129235 is fixed in 0.0.2-0.20260812200004-a76a1920dc75. Upgrade to this version or later.
- Is CVE-2026-129235 exploitable, and should I be worried? Whether CVE-2026-129235 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-129235 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-129235? Upgrade
github.com/kubeshark/kubesharkto 0.0.2-0.20260812200004-a76a1920dc75 or later.