CWE-22 · CWE-88
**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 d