/

CVE-2026-83816

Severity:

HIGH RISK

(8.1)

Command Injection (CWE-78) in CodeWhale ExecShellTool

CVE-2026-83816

Received

Vulnerability type

Category:

Command Injection

CWE:

CWE-78, CWE-863

Impact:

Unauthorized Code Execution

Severity:

HIGH RISK

(8.1)

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 terminal agent could classify certain commands as read-only and automatically approve them even when their options selected an external program. If attacker-controlled content influenced a tool call, this behavior could allow arbitrary program execution on the developer's host without the expected approval prompt.

Affected context

The issue affected CodeWhale versions before 0.9.0 in the ExecShellTool approval and command-safety paths. Commands such as fd, rg, and git grep could be treated as read-only based on their base utility name, even when options caused them to run another program or open files in an external pager. Risk depended on attacker-controlled content influencing an agent tool call in a developer environment using the default interactive profile.

Exploit preconditions

  • Attack surface: CodeWhale's terminal agent and its ExecShellTool command execution path
  • Required access: A way to supply or influence content that the agent uses when forming a tool call
  • Trigger point: The agent processes a command classified as automatically approved and invokes it
  • Why exploitation is possible: Flag-stripped allowlist checks and later safety checks treated certain utilities as safe without accounting for options that launch external programs; automatic approval bypassed the expected prompt

Why this happens

The approval logic relied on identifying a command by its base utility name rather than evaluating the full command's behavior. As a result, commands considered read-only could invoke external programs through specific options. This is a command-injection risk (CWE-78) because command execution was not sufficiently constrained, and an authorization weakness (CWE-863) because the approval decision did not enforce the expected user authorization for the resulting action.

Potential impact

  • An attacker may cause arbitrary programs to run on the developer's host
  • Sensitive local data could be accessed or exposed
  • Files or development artifacts could be modified or deleted
  • The host or development workflow could be disrupted

General mitigation guidance

Defensive approaches focus on making approval decisions reflect the actual behavior of a command, not just its base utility name.

  • Prefer structured, narrowly scoped tools over passing composed commands to a shell
  • Treat commands that can launch external programs as requiring explicit approval
  • Use exact command and argument policies that account for option semantics
  • Keep automatic approval limited to operations that are demonstrably read-only
  • Restrict the agent's host access and run it with least privilege
  • Reduce untrusted content's ability to influence tool calls, and preserve user confirmation for sensitive actions

How teams detect issues like this

  • Review approval and safety logic for allowlists that strip flags or classify commands solely by executable name
  • Use static analysis and code review to identify shell execution paths and options that invoke external programs
  • Test policy behavior for commands with subprocess, pager, or execution options, and verify that sensitive actions still require approval
  • Enforce policies that prevent unapproved shell execution and require explicit authorization for commands outside a narrowly defined safe set

Automated code review tools may help identify risky command execution and authorization patterns.

Sources

SourceLink
github.comgithub.com/codewhale-hq/Codewhale/commit/208421b9d23d81cea3311a1eeb2a2ea81d637686
github.comgithub.com/codewhale-hq/Codewhale/releases/tag/v0.9.0
github.comgithub.com/codewhale-hq/Codewhale/security/advisories/GHSA-3mgh-93r5-r7jf

Frequently asked

questions

The described path involves a local terminal agent, not a direct network service. Exploitation depends on attacker-controlled content influencing a tool call that the agent executes.

An attacker needs a way to influence content used by the agent. The issue becomes relevant when the agent processes that content and invokes a command that is automatically classified as safe.

Make approval decisions based on the full command behavior, and require explicit user authorization for commands that can invoke external programs.

Prefer structured tools to shell commands, constrain tool permissions, test approval policies against command options, and avoid granting automatic approval based only on executable names.

Find out what's already
exploitable in your codebase.