#21661: fix(agents): treat approval timeout as denial regardless of askFallback
agents
size: M
Cluster:
OpenClaw Plugin Enhancements
## Summary
- When an exec approval request times out (`!decision`), the handler previously auto-approved the command if `askFallback === 'full'`, granting elevated permissions on timeout.
- This removes the `askFallback === 'full'` auto-approve path in the timeout branch so that timeouts always result in denial with `deniedReason = "approval-timeout"`.
- The `allowlist` fallback path is preserved: on timeout, allowlist-satisfied commands may still proceed, but unrestricted `full` fallback no longer auto-approves.
## Test plan
- [ ] Verify that exec commands with `askFallback = 'full'` are denied when the approval request times out
- [ ] Verify that `askFallback = 'allowlist'` still works correctly on timeout (allowlist-satisfied commands approved, others denied)
- [ ] Verify that explicit user decisions (`allow-once`, `allow-always`, `deny`) are unaffected
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Closes a security vulnerability where exec approval request timeouts would auto-approve commands when `askFallback = 'full'` is configured. The fix removes the auto-approval path on timeout, ensuring that timeouts always result in denial with `deniedReason = "approval-timeout"`. The `allowlist` fallback path is preserved correctly.
- Removed unsafe auto-approval on timeout for `askFallback = 'full'`
- Timeouts now consistently deny execution instead of granting elevated permissions
- `allowlist` fallback continues to work as intended (allowlist-satisfied commands approved, others denied)
Note: The parallel code in `bash-tools.exec-host-node.ts` still contains the same vulnerability (lines 206-208) and should be fixed in a follow-up.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge - it fixes a critical security vulnerability
- The fix correctly closes a security hole where timeouts granted elevated permissions. However, the identical vulnerability exists in `bash-tools.exec-host-node.ts` and should be fixed as well.
- Check `bash-tools.exec-host-node.ts` for the same vulnerability
<sub>Last reviewed commit: f6abfea</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#20435: fix(exec): prioritize user 'always allow' config over tool defaults...
by ChisomUma · 2026-02-18
80.8%
#18193: fix: default elevatedDefault to 'off' instead of 'on' (#18177)
by lailoo · 2026-02-16
78.9%
#21663: fix(gateway): prevent self-approval of timed-out exec requests
by AI-Reviewer-QS · 2026-02-20
78.8%
#8464: feat: make exec approval timeout configurable
by fabioaraujopt · 2026-02-04
78.6%
#19624: fix: elevatedDefault should default to off when tools.elevated.enab...
by stakeswky · 2026-02-18
77.0%
#19684: fix: change elevatedDefault fallback from 'on' to 'off'
by neipor · 2026-02-18
75.8%
#21733: security(exec): platform-aware allowlist matching and restricted sa...
by Esubaalew · 2026-02-20
75.4%
#23309: fix: remove 30-minute timeout for background exec sessions
by vksvikas · 2026-02-22
75.3%
#9200: Fix: Strip dangerous env vars from baseEnv in host execution
by vishaltandale00 · 2026-02-05
75.3%
#14127: fix(exec): return command output when gateway approval is Always Allow
by Siziff · 2026-02-11
75.1%