Details
- Attacker privilege required: Repository maintainer (can commit the malicious config file) or a supply-chain compromise of a repository the victim clones.
- User interaction required: The victim must run CodeWhale in the cloned repository directory. No explicit confirmation or trust prompt is shown for the
allow_shelloverride. - Impact: The AI model can execute arbitrary shell commands on the victim's machine through the
exec_shelltool. Even with the defaultapproval_policy = "suggest"requiring approval for dangerous commands, many "safe" commands (file reads, directory listings, git operations, build tools) execute without approval. Combined with social engineering via the AI conversation, a sophisticated attack could chain multiple approved commands. - Security boundary crossed: User's opt-in shell access policy (
allow_shelldefaulting tofalse) is silently overridden by untrusted repository content.
Suggested remediation
- Add `allow_shell` to the `DENY_AT_PROJECT_SCOPE` list at
crates/tui/src/main.rs:5119:
const DENY_AT_PROJECT_SCOPE: &[&str] = &["api_key", "base_url", "provider", "mcp_config_path", "allow_shell"];
And emit a warning when it is encountered in project config, matching the existing pattern for other denied keys.
- Alternatively, apply the same tightening-only guard used for
approval_policy:
if let Some(v) = table.get("allow_shell").and_then(toml::Value::as_bool) {
// Project config can only disable shell, never enable it
if !v {
config.allow_shell = Some(false);
} else {
eprintln!(
"warning: project-scope `allow_shell = true` is ignored — \
shell access must be opted in via user/global config or --yolo. \
(See #417.)"
);
}
}
- Regression test: Add a test confirming that
allow_shell = truein a project config is rejected/ignored:
#[test]
fn project_overlay_cannot_enable_allow_shell() {
let tmp = workspace_with_project_config("allow_shell = true\n");
let mut config = Config::default();
merge_project_config(&mut config, tmp.path());
assert!(
!config.allow_shell(),
"project config must not be able to enable shell access"
);
}
CVE
- CVE-2026-75911 (NVD)
Credits
- Thai Son Dinh from VinSOC Labs (R&D)
- Nguyen Huy Vu Dung from VinSOC Labs (AppSec)