CVE-2026-45311: CodeWhale: run_tests Tool Enables RCE via Malicious Repository Without Approval
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.
Security readout for executives and security teams
Plain-English summary
CVE-2026-45311 lets a malicious repository make CodeWhale run test code without asking the user. Because Rust tests, build scripts, and proc macros can execute code, this can lead to credential theft, persistence, or full host compromise when a user opens or works in a hostile repo.
Executive priority
Prioritize remediation for developer machines handling source code, secrets, or customer systems. The business risk is high because normal agent behavior can become code execution without an approval prompt.
Technical view
CodeWhale versions >=0.3.0 and <0.8.23 run the run_tests tool with ApprovalRequirement::Auto, executing cargo test without approval. cargo test can compile and execute arbitrary repository code, including test binaries, build.rs scripts, and proc macros. AGENTS.md auto-loading can increase risk by prompting proactive test execution.
Likely exposure
Exposure is likely limited to teams using CodeWhale versions before 0.8.23, especially on developer workstations or CI-like environments that open untrusted or external repositories.
Exploitation context
The source bundle does not report active exploitation, and KEV is false. Exploitation requires user interaction with a malicious repository, but no further privilege is required once CodeWhale auto-runs tests in that workspace.
Researcher notes
The core boundary issue is auto-approved test execution in a coding agent. Evidence supports arbitrary code execution through Rust test/build mechanisms and AGENTS.md prompt influence, but sources do not provide exploit telemetry or broader product impact.
Mitigation direction
Upgrade CodeWhale to version 0.8.23 or later.
Avoid using affected CodeWhale versions with untrusted repositories.
Do not run affected versions where developer credentials or production secrets are available.
Review the GitHub advisory for any updated vendor guidance.
Treat exposed tokens as potentially compromised if tests ran in a malicious workspace.
Validation and detection
Inventory CodeWhale installations and identify versions >=0.3.0 and <0.8.23.
Confirm upgraded systems report CodeWhale version 0.8.23 or later.
Review session history for automatic run_tests or cargo test execution in untrusted repositories.
Check whether affected sessions had access to credentials, tokens, SSH keys, or cloud secrets.
Look for unexpected persistence or outbound activity after suspicious CodeWhale sessions.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · medium confidence lookup
CWE-94: Code execution behavior lookup
Code execution and unsafe deserialization weaknesses often justify reviewing execution behavior and process telemetry. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
The CVE wording references code or command execution, so execution technique review may help defensive triage. This is a Glexia inferred lookup path, not an official MITRE, ATT&CK, or CVE Program mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
1ADP providers
2Source links
SSVC decision data
CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: noTechnical Impact: total
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-94 · source CWE mapping
Improper Control of Generation of Code ('Code Injection')
Improper Control of Generation of Code ('Code Injection') represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.