Detect CodeWhale exec_shell Parallel-Readonly Classifier RCE (CVE-2026-83816) in IBM QRadar
Detects exploitation of CVE-2026-83816, a command-injection and broken-authorization flaw in CodeWhale (codewhale-tui and codewhale, Rust and npm distributions) at or below version 0.8.67. The exec_shell tool's parallel-readonly classifier treats fd, rg (ripgrep) and git grep as always-safe read-only commands and auto-approves them without user confirmation. Each of these tools exposes exec-style flags (fd's --exec, -x and --exec-batch, ripgrep's --pre preprocessor, and git grep's -O / --open-files-in-pager) that spawn arbitrary child processes. An attacker who can influence the agent's command stream (for example via a malicious repo, prompt injection, or crafted project files) can run arbitrary code past the approval gate without a prompt. This detection hunts for CodeWhale child processes invoking fd, rg or git grep with exec-capable flags, and for the unexpected grandchild processes they spawn. Fixed in version 0.9.0 (commit 208421b).
MITRE ATT&CK
- Tactic
- Execution Privilege Escalation
QRadar Detection Query
-- df00tech DF00-d0b471d785 · https://df00tech.com/detections/CVE-2026-83816 · licence: https://df00tech.com/detections/licence
SELECT QIDNAME(qid) AS event, "Process Name" AS process, "Parent Process Name" AS parent, "Process CommandLine" AS cmd, username, sourceip, devicetime
FROM events
WHERE (LOWER("Parent Process Name") LIKE '%codewhale%' OR LOWER("Parent Process Name") = 'node')
AND (
LOWER("Process Name") IN ('fd','fd.exe','fdfind','rg','rg.exe','ripgrep')
OR (LOWER("Process Name") IN ('git','git.exe') AND "Process CommandLine" ILIKE '%grep%')
)
AND (
"Process CommandLine" ILIKE '%--exec%' OR "Process CommandLine" ILIKE '% -x %'
OR "Process CommandLine" ILIKE '%--pre %' OR "Process CommandLine" ILIKE '%--open-files-in-pager%'
OR "Process CommandLine" ILIKE '% -O %'
)
ORDER BY devicetime DESC LAST 7 DAYS QRadar AQL querying process events for CodeWhale-spawned fd/rg/git-grep with exec flags.
Data Sources
Required Tables
False Positives & Tuning
- Batch file processing via fd --exec by developers
- Compressed-archive search with rg --pre
- git grep pager usage in developer workflows
Other platforms for CVE-2026-83816
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are further down this page.
- Test 1 fd --exec classifier bypass (Linux)
Expected signal: Process-creation event showing fd (or fdfind) with -x/--exec spawning sh as a child process.
- Test 2 ripgrep --pre preprocessor execution (Linux)
Expected signal: Process-creation event showing rg with --pre spawning the preprocessor shell script.
- Test 3 git grep --open-files-in-pager RCE (macOS)
Expected signal: Process-creation event showing git grep with --open-files-in-pager/-O spawning sh.
References (5)
- https://github.com/codewhale-hq/Codewhale/security/advisories/GHSA-3mgh-93r5-r7jf
- https://nvd.nist.gov/vuln/detail/CVE-2026-83816
- https://github.com/codewhale-hq/Codewhale/commit/208421b9d23d81cea3311a1eeb2a2ea81d637686
- https://github.com/codewhale-hq/Codewhale/releases/tag/v0.9.0
- https://github.com/advisories/GHSA-3mgh-93r5-r7jf
Response Playbook
Triage
- Confirm the installed CodeWhale version on the host (codewhale --version / npm ls codewhale / cargo install list); versions <= 0.8.67 are vulnerable, 0.9.0+ are patched.
- Examine the full command line of the flagged fd/rg/git-grep process and identify the exec-capable flag and the payload it was pointed at (e.g. the script passed to --exec, the preprocessor binary passed to --pre, or the pager for -O).
- Review CodeWhale session/agent logs for the preceding prompt or project file that caused the tool call, to determine whether this was attacker-influenced (malicious repo / prompt injection) versus intentional developer use.
- Enumerate child/grandchild processes spawned under the flagged tool to determine what actually executed.
Containment
- Isolate or restrict the affected host if an unexpected grandchild process (shell, interpreter, network client) was spawned by the fd/rg/git-grep invocation.
- Upgrade CodeWhale to v0.9.0 or later immediately; until then, disable or uninstall CodeWhale or run it only against trusted repositories.
- Kill any running CodeWhale agent sessions and revoke any credentials or tokens that were accessible in the session environment.
Evidence Collection
- Capture the full process tree (CodeWhale -> fd/rg/git -> grandchildren) with command lines, timestamps, and hashes.
- Preserve CodeWhale session transcripts, project files, and any .codewhale/config or repo-supplied instruction files that may contain the injection.
- Collect the script/binary referenced by the exec flag (e.g. the --pre preprocessor or --exec target) for malware analysis.
Escalation Criteria
- !Escalate to IR if a grandchild process is a shell, scripting interpreter, or network/download utility not expected from a read-only search.
- !Escalate if the triggering command originated from an untrusted or externally-cloned repository, indicating active exploitation rather than developer misuse.
- !Escalate if credential access, outbound C2, or persistence artifacts are observed following the tool invocation.
Investigation Guide
Forensic Artifacts
- >
Process-creation events showing CodeWhale/node as parent of fd/rg/git-grep with exec flags - >
CodeWhale session transcripts and repo-supplied config/instruction files - >
Scripts or preprocessor binaries referenced by --exec/--pre/-O flags - >
Shell history and newly created files on the host following the invocation
Tuning Guidance
Baseline legitimate developer and CI use of fd --exec, rg --pre, and git grep -O in your environment and allowlist those parent shells or users. Focus alerting on invocations whose grandchild process is a shell or interpreter, and on cases where the CodeWhale parent processed an untrusted/externally-cloned repository. Once all hosts are confirmed on CodeWhale v0.9.0+, this detection can be downgraded to informational.
Hunting Queries
Hunts for grandchild processes spawned by fd/rg/git-grep, which should never spawn children during a legitimate read-only search.
// df00tech DF00-d0b471d785 · https://df00tech.com/detections/CVE-2026-83816 · licence: https://df00tech.com/detections/licence
DeviceProcessEvents | where InitiatingProcessFileName in~ ("fd","fd.exe","rg","rg.exe","git","git.exe") | where InitiatingProcessCommandLine has_any ("--exec","--pre","--open-files-in-pager","-O") | project Timestamp, DeviceName, InitiatingProcessCommandLine, FileName, ProcessCommandLine ``` df00tech DF00-d0b471d785 · https://df00tech.com/detections/CVE-2026-83816 · licence: https://df00tech.com/detections/licence ```
index=endpoint (sourcetype="Sysmon:ProcessCreate" OR sourcetype="linux:process") | search parent_process_name IN ("fd","rg","git") parent_process IN ("*--exec*","*--pre*","*-O*") | table _time host parent_process process Atomic Red Team Tests
Simulates CodeWhale auto-approving fd as read-only while it spawns an arbitrary command via --exec.
Command
cd /tmp && touch cw_poc_marker && fd -x sh -c 'echo CVE-2026-83816-fd-exec > /tmp/cw_fd_exec.out' cw_poc_marker Cleanup
rm -f /tmp/cw_poc_marker /tmp/cw_fd_exec.out Expected Telemetry
Process-creation event showing fd (or fdfind) with -x/--exec spawning sh as a child process.
Expected Detection
KQL/SPL rule matches fd invocation with -x/--exec flag; grandchild sh process flagged by hunting query.
Simulates ripgrep auto-approved as read-only while --pre executes an arbitrary preprocessor binary.
Command
cd /tmp && echo test > cw_rg_target.txt && printf '#!/bin/sh\necho CVE-2026-83816-rg-pre > /tmp/cw_rg_pre.out\ncat "$1"\n' > /tmp/cw_pre.sh && chmod +x /tmp/cw_pre.sh && rg --pre /tmp/cw_pre.sh test cw_rg_target.txt Cleanup
rm -f /tmp/cw_rg_target.txt /tmp/cw_pre.sh /tmp/cw_rg_pre.out Expected Telemetry
Process-creation event showing rg with --pre spawning the preprocessor shell script.
Expected Detection
Detection matches rg invocation with --pre flag; preprocessor child process surfaced by hunting query.
Simulates git grep auto-approved as read-only while -O/--open-files-in-pager runs an arbitrary pager command.
Command
cd /tmp && rm -rf cw_git_poc && mkdir cw_git_poc && cd cw_git_poc && git init -q && echo needle > file.txt && git add file.txt && git -c core.pager=cat grep --open-files-in-pager='sh -c "echo CVE-2026-83816-git-grep > /tmp/cw_git_grep.out"' needle Cleanup
rm -rf /tmp/cw_git_poc /tmp/cw_git_grep.out Expected Telemetry
Process-creation event showing git grep with --open-files-in-pager/-O spawning sh.
Expected Detection
Detection matches git grep invocation with -O/--open-files-in-pager flag; spawned shell flagged.