/

CVE-2026-75913

Severity:

CRITICAL RISK

(9.3)

Argument Injection (CWE-73) in CodeWhale Git Show Tool

CVE-2026-75913

Deferred

Vulnerability type

Category:

Argument Injection

CWE:

CWE-73

Impact:

Arbitrary File Write

Severity:

CRITICAL RISK

(9.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CodeWhale's git_show tool passes a model-controlled revision value into Git arguments without validating it or terminating option parsing. In affected configurations, prompt injection through a malicious repository may cause an automatically approved, supposedly read-only tool to write arbitrary files with the invoking user's privileges.

Affected context

The vulnerability occurs in CodeWhale versions that expose the git_show tool with an auto-approved execution path. Risk increases when a repository or other untrusted content can influence model prompts, the model can control the rev parameter, and the invoking process has write access to sensitive user files.

Exploit preconditions

  • Attack surface: The CodeWhale git_show tool and its Git subprocess invocation
  • Required access: The attacker generally needs to influence repository content or prompts in a way that causes the model to select a crafted revision argument
  • Trigger point: Processing the model-supplied rev value when constructing the git show argument vector
  • Why exploitation is possible: The value is not sufficiently constrained and option parsing is not explicitly terminated, allowing attacker-controlled input to be interpreted as a Git option
  • Privilege boundary: Resulting file writes occur with the permissions of the CodeWhale process

Why this happens

The underlying bug is insufficient validation of externally influenced data before it is placed into a command-line argument list. Although the value is intended to identify a Git revision, Git may interpret option-like values as command options when argument parsing is not explicitly bounded. This maps to CWE-73: External Control of File Name or Path, because attacker-influenced input can redirect file output to paths outside the intended read-only operation.

Potential impact

  • An attacker may overwrite user-controlled or sensitive files
  • SSH authorization or shell configuration may be modified
  • Git configuration could be altered to influence subsequent operations
  • The invoking user's account or development environment could be compromised
  • Repository integrity, automation workflows, or supply-chain processes could be affected

General mitigation guidance

Mitigation generally focuses on treating model-supplied tool parameters as untrusted command input and preserving the intended read-only behavior.

Common defensive patterns include:

  • Validate revision parameters against a narrowly defined allowlist or expected revision grammar
  • Use explicit end-of-options handling when invoking command-line tools
  • Prefer structured library APIs over shell or argument interfaces where practical
  • Separate data arguments from command options and reject unexpected option-like values
  • Require confirmation for operations with filesystem side effects, even when a tool is described as read-only
  • Run the tool with least-privilege filesystem and process permissions
  • Apply repository isolation and restrict writes to approved working directories

How teams detect issues like this

Organizations can look for:

  • Static analysis findings where model-controlled or repository-controlled values are appended to subprocess argument vectors
  • Code review signals involving missing argument validation, absent end-of-options handling, or read-only tools that invoke output-capable commands
  • Tests that supply boundary-case revision values and verify that no unintended options or filesystem effects occur
  • Policy enforcement requiring explicit approval for tools capable of writing files
  • Runtime monitoring for unexpected writes to SSH, shell, Git configuration, or other protected paths

Automated security review tools may help identify unsafe subprocess construction and mismatches between a tool's advertised behavior and its actual capabilities.

Sources

SourceLink
github.comgithub.com/Hmbown/CodeWhale/commit/9a34b5034d29f05d1f28fa61b04719ca6a741020
github.comgithub.com/Hmbown/CodeWhale/security/advisories/GHSA-7j5w-7r7x-9v27
vulncheck.comvulncheck.com/advisories/codewhale-before-argument-injection-via-git-show

Frequently asked

questions

Exploitation is indirect rather than a conventional network attack. It may occur when untrusted repository content or prompts influence the model and the tool is available for automatic execution.

Direct shell access is not necessarily required, but the attacker must be able to introduce content or prompts that influence the model's tool invocation. The process must also have write access to a target file.

Treat all model-supplied arguments as untrusted, validate them against the intended input format, prevent option reinterpretation, and require approval for operations that can modify files.

Use strict tool schemas, separate read-only and write-capable interfaces, test command construction with adversarial inputs, isolate untrusted repositories, and apply least-privilege permissions.

Find out what's already
exploitable in your codebase.