CVE-2026-45311: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hmbown CodeWhale
CodeWhale is a DeepSeek + MiMo coding agent in terminal. From 0.3.0 to 0.8.23, the run_tests tool executes cargo test in the workspace with ApprovalRequirement::Auto, meaning it runs without any user approval prompt.cargo test compiles and executes arbitrary code: test binaries, build.rs build scripts, and proc macros. While auto-approving test execution is a deliberate design choice, it creates an inconsistency in the security boundary. However, in a malicious repository, test code can execute arbitrary shell commands, exfiltrate credentials, or establish persistence with zero approval. The attack is amplified by AGENTS.md (auto-loaded into the system prompt), which can instruct the model to run tests proactively at session start. This vulnerability is fixed in 0.8.23.
AI Analysis
Technical Summary
Hmbown CodeWhale versions from 0.3.0 to before 0.8.23 include a vulnerability (CWE-94) where the run_tests tool executes 'cargo test' with ApprovalRequirement::Auto, bypassing user approval. Since 'cargo test' compiles and runs arbitrary code including test binaries, build scripts, and procedural macros, this design choice creates a security boundary inconsistency. Malicious code in a repository can leverage this to execute arbitrary shell commands, steal credentials, or maintain persistence without user interaction. The AGENTS.md file can further automate this exploitation by instructing the model to run tests at session start. The vulnerability is resolved in version 0.8.23.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code on the system running CodeWhale without user approval, potentially leading to credential theft, system persistence, and full compromise of confidentiality, integrity, and availability. The CVSS v3.1 score is 9.6 (critical), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability. No known exploits in the wild have been reported.
Mitigation Recommendations
This vulnerability is fixed in CodeWhale version 0.8.23. Users should upgrade to version 0.8.23 or later to remediate the issue. Patch status is not explicitly confirmed in the vendor advisory, but the description states the vulnerability is fixed in 0.8.23. Until upgrading, users should avoid running CodeWhale on untrusted repositories or disable automatic test execution if possible.
CVE-2026-45311: CWE-94: Improper Control of Generation of Code ('Code Injection') in Hmbown CodeWhale
Description
CodeWhale is a DeepSeek + MiMo coding agent in terminal. From 0.3.0 to 0.8.23, the run_tests tool executes cargo test in the workspace with ApprovalRequirement::Auto, meaning it runs without any user approval prompt.cargo test compiles and executes arbitrary code: test binaries, build.rs build scripts, and proc macros. While auto-approving test execution is a deliberate design choice, it creates an inconsistency in the security boundary. However, in a malicious repository, test code can execute arbitrary shell commands, exfiltrate credentials, or establish persistence with zero approval. The attack is amplified by AGENTS.md (auto-loaded into the system prompt), which can instruct the model to run tests proactively at session start. This vulnerability is fixed in 0.8.23.
CVSS v3.1
Score 9.6critical
Affected software
pkg:cargo/github/Hmbown/codewhaleRun on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Hmbown CodeWhale versions from 0.3.0 to before 0.8.23 include a vulnerability (CWE-94) where the run_tests tool executes 'cargo test' with ApprovalRequirement::Auto, bypassing user approval. Since 'cargo test' compiles and runs arbitrary code including test binaries, build scripts, and procedural macros, this design choice creates a security boundary inconsistency. Malicious code in a repository can leverage this to execute arbitrary shell commands, steal credentials, or maintain persistence without user interaction. The AGENTS.md file can further automate this exploitation by instructing the model to run tests at session start. The vulnerability is resolved in version 0.8.23.
Potential Impact
Successful exploitation allows an attacker to execute arbitrary code on the system running CodeWhale without user approval, potentially leading to credential theft, system persistence, and full compromise of confidentiality, integrity, and availability. The CVSS v3.1 score is 9.6 (critical), reflecting network attack vector, low attack complexity, no privileges required, user interaction required, and high impact on confidentiality, integrity, and availability. No known exploits in the wild have been reported.
Mitigation Recommendations
This vulnerability is fixed in CodeWhale version 0.8.23. Users should upgrade to version 0.8.23 or later to remediate the issue. Patch status is not explicitly confirmed in the vendor advisory, but the description states the vulnerability is fixed in 0.8.23. Until upgrading, users should avoid running CodeWhale on untrusted repositories or disable automatic test execution if possible.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-11T20:50:30.538Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a188377e29bf47b50179037
Added to database: 05/28/2026, 18:03:35 UTC
Last enriched: 06/04/2026, 20:39:04 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 102
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.