Skip to content
Beta
All articles

CodeWhale's read-only shell classifier: when fd, rg and git grep run programs

Two CodeWhale advisories show how a name-based read-only allowlist and an auto-approve default skipped approval prompts, and how to check your agents.

By The SpanDock team

5 min read

A diagram of a shell command passing a read-only classifier: the classifier strips flags, sees the base name fd, rg or git grep on its allowlist and skips the approval prompt, although flags such as fd -x, rg --pre and git grep -O start another program

Most coding agents try to spare developers from approving every harmless command. A search with rg or a file listing with fd shouldn't need a click. Two advisories that CodeWhale published on 12 November 2026 show how that convenience can quietly become a hole. In the terminal agent's default interactive profile, a classifier treated fd, rg and git grep as read-only by their names alone, and skipped the approval prompt. All three tools have documented flags that start other programs. A second flaw let a scheduled automation approve every tool call on its own. Both are fixed, and the fixes shipped months before the advisories. The lesson applies well beyond one tool.

What CodeWhale is and what was affected

CodeWhale (also referred to in the advisories as DeepSeek-TUI) is an open-source terminal coding agent written in Rust, distributed on npm as codewhale and as the Rust crate codewhale-tui. Both advisories list versions 0.8.67 and earlier as affected and 0.9.0 as patched.

The dates need care. The advisories were published on 12 November 2026, but the v0.9.0 release is dated 16 July 2026, and the fixing commit was made the same day. Releases up to 0.10.2 have followed since. Anyone who has updated since July is already patched; the advisories matter most for pinned installs, internal mirrors and machines that nobody updates.

The read-only classifier

The first advisory, GHSA-3mgh-93r5-r7jf (CVE-2026-83816, rated high at CVSS 8.1), describes the chain. The interactive Agent profile is documented to put every shell command behind an approval prompt. A classifier could downgrade that requirement for commands it judged "parallel read-only", and when it did, no prompt appeared, even for a user who had never turned on the agent's no-approval mode.

The classifier rejected shell metacharacters such as pipes, redirects and command substitution. It then stripped all flags and compared the base command name against an allowlist that included fd, rg and git grep. The flags were exactly the problem:

  • fd runs an external command for each search result with -x/--exec, or once for all results with -X/--exec-batch, as the fd README describes.
  • ripgrep passes each file through a preprocessor program of your choosing with --pre, documented in the ripgrep guide as a way to search PDFs and other formats.
  • git grep opens matching files in a program named by -O/--open-files-in-pager, per the git-grep documentation.

None of these needs a shell metacharacter. A command such as fd -tf -x ./script.sh contains nothing the filter looked for, reduces to fd once flags are stripped, and matches the allowlist. The advisory's proof of concept assumes the familiar starting point: indirect prompt injection from a repository file, an issue or a fetched page that steers the model into emitting such a command. The report also notes that a later safety check rated fd and rg as safe, so nothing else stopped the call.

The fix, according to the commit message, makes the classifier reject fd -x/-X/--exec/--exec-batch, rg --pre and git grep -O/--open-files-in-pager, "including combined short-flag and equals forms", so those invocations go through normal approval.

The automation default

The second advisory, GHSA-8hp3-xxrg-v9c8 (CVE-2026-83817, high at CVSS 7.5), is a different shape of the same problem. An earlier fix, for CVE-2026-45374, had made auto-approval of tasks opt-in. Scheduled automations were not changed in the same way: if auto_approve was omitted, an automation resolved it to true and passed that explicitly to each task it created, which bypassed the task-level default. The result, in the advisory's words, is that one approved automation_create "yields a durable, recurring, fully auto-approved agent", which approves file writes, patches, git and MCP writes with no one present. In 0.9.0 the default is false.

What it means for engineering and security leaders

Name-based allowlists are not a security boundary. Many tools are read-only in ordinary use and code-executing with one flag. find -exec and GNU tar --to-command are other well-known examples. Any classifier that decides "safe" from the base command name will eventually meet one of them. If a classifier exists at all, it has to understand flags, and it should fail towards prompting when it isn't sure.

Check where the prompt decision happens. In CodeWhale, an "automatic" requirement returned before the user's approval setting was even consulted. When you evaluate any agent, ask which code paths can skip the prompt entirely, not only what the prompt setting says.

Defaults travel badly between subsystems. The automation flaw existed because one fix covered one code path. When a vendor fixes an insecure default, it is fair to ask whether every other place that creates the same kind of object has the same default.

Advisory dates aren't fix dates. As with other advisories this autumn, the public notice arrived months after the patch. Inventories that track "known vulnerable versions" only from advisory feeds will lag the real exposure window in both directions.

Practical takeaways

  • Find CodeWhale installs on developer machines and CI images, and make sure they run 0.9.0 or later. The current release line is 0.10.x.
  • Review existing automations. Any automation created on 0.8.67 or earlier without an explicit auto_approve value ran with auto-approval; check what they do and recreate them with the value set deliberately.
  • Test your own agents' auto-approve lists with exec-capable flags: fd -x, rg --pre, git grep -O, find -exec. If any of them runs without a prompt, raise it with the vendor.
  • Prefer content-aware rules to name lists. Where an agent supports deny or ask rules on full command patterns, write them for the dangerous flags, not just the commands.
  • Treat a prompt as one layer. Combine it with a sandbox that limits what an approved command can reach, so a classifier mistake doesn't become full access to the machine.

For teams running Claude Code, Codex or Gemini CLI, SpanDock's guardrails can match your own regular expression in the arguments of tool calls, such as --pre or -x after rg or fd, and require the person to confirm before the call runs, with every match recorded. A pattern catches the flags you list, not every way to run a program. Guardrails on computers are on the Enterprise plan; see guardrails.

For more on approvals that don't approve what they appear to, see what an agent approval actually approves.

Sources

  1. CodeWhale advisory GHSA-3mgh-93r5-r7jf (CVE-2026-83816): exec_shell parallel-readonly classifier auto-approves fd/rg/git grep exec flags
  2. CodeWhale advisory GHSA-8hp3-xxrg-v9c8 (CVE-2026-83817): automation auto_approve defaults to true
  3. CodeWhale v0.9.0 release
  4. fd README: command execution (-x/--exec, -X/--exec-batch)
  5. ripgrep user guide: preprocessor (--pre)
  6. Git documentation: git-grep (--open-files-in-pager)
Cookie categories

Details: Cookie Policy.