CVE-2026-129235: Kubeshark MCP `download_file` Writes Fetched Bytes Vulnerability

MODERATE
Advisory Identifier: GHSA-gj7r-p794-hhq5
CVSS 5.3
CWE-88 CWE-22
Published
Advisory Summary

CVE-2026-129235 is a MODERATE (CVSS 5.3) mcp `download_file` writes fetched bytes vulnerability (CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')) affecting Kubeshark libraries in the Go ecosystem. The issue involves mcp `download_file` writes fetched bytes to an unvalidated destination path. Remediation is available by upgrading affected packages to version 0.0.2-0.20260812200004-a76a1920dc75.

CVE-2026-129235 at a Glance

CVE Identifier CVE-2026-129235
GHSA Identifier GHSA-gj7r-p794-hhq5
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')
Affected Product Kubeshark
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-129235

To remediate this vulnerability, upgrade all affected Kubeshark dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/kubeshark/kubeshark fixed: 0.0.2-0.20260812200004-a76a1920dc75
Upgrade github.com/kubeshark/kubeshark to 0.0.2-0.20260812200004-a76a1920dc75
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/kubeshark/kubeshark

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-129235, inspect your project dependencies for Kubeshark:

inspect dependencies for github.com/kubeshark/kubeshark

Analyze the terminal output to locate any version of Kubeshark in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.0.2-0.20260812200004-a76a1920dc75), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection'), where the product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string. In Kubeshark, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**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. ## Summary 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 driving `kubeshark 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: - `dest` was passed directly to `os.Create(dest)` with no confinement — no `filepath.Clean`, no base-directory containment, no rejection of absolute paths or `../` traversal. Any path the process can write is reachable. - `path` was 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 default `kubeshark 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 that `path` 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. ## 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). ## 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 mcp` is 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 running `kubeshark 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 original `A:L` is 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 against `kubeshark mcp`), and **`S:U`** (the impact stays within the local user's authorization scope). ## Patches Fixed in **v53.4.0** by commit [`a76a1920`](https://github.com/kubeshark/kubeshark/commit/a76a1920dc7587be700a17f1592f58a9512ad214) (PR [#1957](https://github.com/kubeshark/kubeshark/pull/1957)). Changes in `cmd/mcpRunner.go`: - `dest` is resolved through `secureDownloadDest` and confined to a base directory (the CWD by default, relocatable via `KUBESHARK_MCP_DOWNLOAD_DIR`); a `dest` that resolves outside the base (via `../` or an absolute path) is rejected. - `path` is rejected if it contains `..` segments. - Containment is re-checked after resolving symlinks, so a symlinked subdirectory inside the base (or a `dest` that is itself a symlink) cannot redirect the write outside it; the file is opened with `O_NOFOLLOW` where the platform provides it. - Credential forwarding + auth-required detection on the fetch (shipped in the gated-auth refactor). ## Workarounds - Run `kubeshark mcp` as 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).

CVE-2026-129235 Affected Kubeshark Versions

1 component(s)
Fixed Versions:
0.0.2-0.20260812200004-a76a1920dc75
Product / Package Ecosystem Affected Versions Fixed Version
github.com/kubeshark/kubeshark
Go
≥ 0.0.2-0.20260304171723-eb7dc42b6ea0
< 0.0.2-0.20260812200004-a76a1920dc75
0.0.2-0.20260812200004-a76a1920dc75

References

Frequently Asked Questions

What is CVE-2026-129235?
CVE-2026-129235 is a security vulnerability in Kubeshark involving MCP `download_file` writes fetched bytes to an unvalidated destination path under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection').
Which Kubeshark versions are affected?
Affected versions include releases prior to 0.0.2-0.20260812200004-a76a1920dc75 across affected packages: github.com/kubeshark/kubeshark.
What version fixes CVE-2026-129235?
Upgrading to 0.0.2-0.20260812200004-a76a1920dc75 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/kubeshark/kubeshark affected?
Yes, github.com/kubeshark/kubeshark is affected in releases prior to 0.0.2-0.20260812200004-a76a1920dc75. Upgrade your dependency to 0.0.2-0.20260812200004-a76a1920dc75 or later.
What is the CVSS score of CVE-2026-129235?
CVE-2026-129235 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2026-129235?
CVE-2026-129235 is classified under CWE-88: Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') (The product constructs a string for a command to be executed by a separate component in another control sphere, but it does not properly delimit the intended arguments, options, or switches within that command string.).
How can I check Go dependencies for CVE-2026-129235?
Run the dependency tree command: 'inspect dependencies for github.com/kubeshark/kubeshark'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gj7r-p794-hhq5",
  "modified" : "2026-11-16T22:18:58Z",
  "published" : "2026-11-16T22:18:58Z",
  "aliases" : [ "CVE-2026-129235" ],
  "summary" : "Kubeshark: MCP `download_file` writes fetched bytes to an unvalidated destination path",
  "details" : "**Ecosystem / package:** Go — `github.com/kubeshark/kubeshark` (the `kubeshark`\nCLI, `kubeshark mcp` subcommand)\n**Affected component:** `cmd/mcpRunner.go`, MCP tool `download_file`\n**Affected versions:** `>= v53.1.0`, `< v53.4.0` (the flaw shipped with the\ntool's first release; v53.3.0 was the last affected release)\n**Patched version:** `v53.4.0`\n**Credit:** novice-22 (Urim), via private coordinated disclosure.\n\n## Summary\nThe `download_file` MCP tool fetches a caller-supplied `path` from the Kubeshark\nHub API and writes the response body to a caller-supplied `dest` on the local\nfilesystem with no validation of `dest`. An attacker who can influence the MCP\ntool arguments — e.g. via indirect prompt injection against an AI agent driving\n`kubeshark mcp` — can write attacker-controlled bytes to an arbitrary path\nwritable by the user running the MCP server (e.g. `~/.ssh/authorized_keys`,\n`~/.kube/config`, `~/.bashrc`), and can request arbitrary Hub API endpoints.\n`download_file` is registered unconditionally (available in the default,\nnon-`--allow-destructive` posture).\n\n## Introduced in\nCommit `eb7dc42b` — \"Add get_file_url and download_file MCP tools (#1853)\",\n2026-03-04 — first released in **v53.1.0** (`v53.1.0~1`). An earlier attempt\n(`dbfd17d9`) was reverted (`a46f05c4`) before any release, so no tag before\nv53.1.0 is affected.\n\n## Details\nIn `callDownloadFile` (`cmd/mcpRunner.go`), both `path` and `dest` come straight\nfrom the tool arguments:\n- `dest` was passed directly to `os.Create(dest)` with no confinement — no\n  `filepath.Clean`, no base-directory containment, no rejection of absolute\n  paths or `../` traversal. Any path the process can write is reachable.\n- `path` was concatenated onto the Hub API base URL with no allowlist, so any\n  Hub endpoint (including captured-traffic exports) is reachable.\n\n## Auth context (CWE-306 / CWE-200)\nThe tool originally issued the fetch with no authentication. The authentication\ngap was addressed by the gated-Hub authentication refactor: the download now\nforwards the operator's Hub credentials (ServiceAccount token / License-Key) and\nrejects auth-required responses instead of writing a login page to disk. **But**\nthe Hub ships auth-disabled by default (community/dev), so on a default\n`kubeshark tap` the Hub API answers without authentication and captured traffic\n(credentials/tokens/PII) can still be read and exfiltrated end-to-end. Enforcing\nHub auth by default is tracked separately (gated-auth workstream) and is **not**\npart of this advisory's fix.\n\n## Proof of concept (reporter, abridged)\nFollowing the tool's documented workflow on a default community install:\n`export_snapshot_pcap` → obtain a relative path → `download_file` with that\n`path` and an attacker-chosen `dest`. The reporter retrieved a captured-traffic\nPCAP and recovered a planted canary `Authorization: Bearer …` credential from\nit, and demonstrated writing the fetched bytes to an arbitrary local path.\n\n## Impact\n- **Integrity (local):** arbitrary file write on the machine running\n  `kubeshark mcp`, as that user.\n- **Confidentiality:** read of Hub API endpoints, incl. captured network traffic\n  (credentials, tokens, PII) on a default (auth-disabled) install.\n- Reliable RCE is not demonstrated (script endpoints are JSON-wrapped).\n\n## Severity rationale\nKubeshark scores this **5.3 Medium**, down from the reporter's 7.1, on two metrics:\n\n- **`AV:N` → `AV:L`.** The vulnerable component has no network listener the\n  attacker reaches. `kubeshark mcp` is a local stdio MCP server; the attacker's\n  input arrives as content an agent running on that host ingests and then\n  replays into a local tool call. The delivery of the poisoned content may cross\n  a network, but the attack surface being exploited is local to the machine.\n- **`I:H` → `I:L`.** The write is confined to paths writable by the user running\n  `kubeshark mcp` (normally unprivileged) — no system-file or other-user\n  modification. The attacker also controls *where* the bytes land, not *what*\n  they are: the body comes from a Hub API response, so the content is\n  constrained to what the Hub will emit. Reliable RCE was not demonstrated.\n- **`A:L` → `A:N`.** Nothing in the issue degrades availability of the CLI, the\n  Hub, or the host; the original `A:L` is unsupported.\n\nKubeshark kept **`C:H`**: on a default community install the Hub API answers\nunauthenticated, so captured traffic (credentials, tokens, PII) is genuinely\nreadable end-to-end. Kubeshark kept **`AC:H`** (the attacker must land an injection in\ncontent the agent ingests and know the deployment layout), **`PR:N`**\n(`download_file` is registered unconditionally — no `--allow-destructive`\nneeded), **`UI:R`** (an operator must be driving an agent against\n`kubeshark mcp`), and **`S:U`** (the impact stays within the local user's\nauthorization scope).\n\n## Patches\nFixed in **v53.4.0** by commit\n[`a76a1920`](https://github.com/kubeshark/kubeshark/commit/a76a1920dc7587be700a17f1592f58a9512ad214)\n(PR [#1957](https://github.com/kubeshark/kubeshark/pull/1957)).\n\nChanges in `cmd/mcpRunner.go`:\n- `dest` is resolved through `secureDownloadDest` and confined to a base\n  directory (the CWD by default, relocatable via `KUBESHARK_MCP_DOWNLOAD_DIR`);\n  a `dest` that resolves outside the base (via `../` or an absolute path) is\n  rejected.\n- `path` is rejected if it contains `..` segments.\n- Containment is re-checked after resolving symlinks, so a symlinked\n  subdirectory inside the base (or a `dest` that is itself a symlink) cannot\n  redirect the write outside it; the file is opened with `O_NOFOLLOW` where the\n  platform provides it.\n- Credential forwarding + auth-required detection on the fetch (shipped in the\n  gated-auth refactor).\n\n## Workarounds\n- Run `kubeshark mcp` as an unprivileged user in an isolated working directory.\n- Do not expose the MCP server to untrusted content / untrusted agent inputs.\n- Enable Hub authentication (`AUTH_ENABLED=true` + an IdP/license) to close the\n  unauthenticated read path.\n\n## Follow-ups (not blocking this advisory)\n- Strict prefix allowlist for the Hub `path` (current fix only rejects `..`).\n- Hub-side default auth enforcement (gated-auth workstream).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/kubeshark/kubeshark"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.0.2-0.20260304171723-eb7dc42b6ea0"
      }, {
        "fixed" : "0.0.2-0.20260812200004-a76a1920dc75"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kubeshark/kubeshark/security/advisories/GHSA-gj7r-p794-hhq5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-129235"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubeshark/kubeshark/pull/1957"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubeshark/kubeshark/commit/a76a1920dc7587be700a17f1592f58a9512ad214"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kubeshark/kubeshark"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kubeshark/kubeshark/releases/tag/v53.4.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-22", "CWE-88" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-16T22:18:58Z",
    "nvd_published_at" : "2026-11-16T17:17:31Z"
  }
}