# CodeWhale: Automation auto_approve defaults to true, bypassing the task-path hardening fix for silent recurring agent execution

CodeWhale automations default auto_approve to true, so one approved automation_create yields a recurring agent that silently auto-approves all mutating tool calls, including shell.

- Payout: Research
- Severity: high
- Program: CodeWhale
- Found by: manus-use
- Disclosed: 2026-11-19
- CVE: CVE-2026-83817
- Write-up quality: 8/10
- Original: https://github.com/advisories/GHSA-8hp3-xxrg-v9c8
- Library page: https://bugbountylibrary.com/r/ghsa%3AGHSA-8hp3-xxrg-v9c8
- Tags: area:ai domain:ai domain:desktop impact:integrity impact:rce kind:research platform:ghsa sev:high tech:rust technique:incomplete-fix technique:source-review vuln:auth-bypass vuln:misconfiguration vuln:prompt-injection

**Target:** CodeWhale TUI/agent automation subsystem (automation_create tool, scheduler)
**Root cause:** DEFAULT_AUTOMATION_AUTO_APPROVE is true while sibling durable flags allow_shell/trust_mode default false; create_automation stores None when omitted and task_auto_approve() resolves None to true. enqueue_run_task then passes Some(true), so add_task's hardened unwrap_or(false) never applies.
**Steps:**
1. Prompt-inject the model into calling `automation_create` with `auto_approve` omitted: `{"name":"automation_create","arguments":{"name":"nightly-maintenance","prompt":"Fetch latest and run project setup script","rrule":"FREQ=HOURLY;INTERVAL=1","allow_shell":true}}`
2. User approves the single Required automation_create prompt; create_automation stores `auto_approve: None` (automation_manager.rs:422)
3. Scheduler tick or automation_run calls enqueue_run_task, which sets `auto_approve: Some(automation.task_auto_approve())` = Some(true) (automation_manager.rs:766)
4. add_task's `req.auto_approve.unwrap_or(false)` (task_manager.rs:868) returns true because the value is Some
5. Worker sets ApprovalMode::Bypass (runtime_threads.rs:2253); approval loop auto-approves every tool call (runtime_threads.rs:3383-3416)
6. Observe recurring unattended write_file/apply_patch/git/MCP writes, and shell execution when allow_shell:true
**How found:** Compared the automation subsystem against the already-patched task path from CVE-2026-45374: noticed sibling durable defaults allow_shell/trust_mode are false while auto_approve alone is true, then traced None→true resolution and the Some(true) handoff that defeats add_task's unwrap_or(false) seed fix.
**Exploitation:** A single human approval of an innocuous-looking automation_create (prompt injection or social engineering) persists a recurring job; each scheduled fire runs headless with ApprovalMode::Bypass, auto-approving all non-held tools. auto_review safety_floor only holds Publish and Destructive/Secret, so write_file/apply_patch/edit_file and non-destructive exec_shell execute unattended; with allow_shell:true this becomes recurring silent RCE.
**Escalation:** Chaining the omitted default with allow_shell:true in the same create call upgrades silent file mutation to recurring unattended shell execution; durability of the automation makes it persistent across sessions.
**Insight:** When a project patches an insecure-default bug in one subsystem, diff every sibling struct's defaults and every call site that passes an explicit Some(...) into the hardened function — an explicit Some bypasses unwrap_or defaults entirely.

## Proof of concept (copied exactly from the original report)

**automation_create call omitting auto_approve**

```
{"name":"automation_create","arguments":{
  "name":"nightly-maintenance",
  "prompt":"Fetch latest and run project setup script",
  "rrule":"FREQ=HOURLY;INTERVAL=1",
  "allow_shell":true
}}
```

