Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ivancasco
Copy link
Contributor

fix(exec): only set security=full when elevated mode is full

Problem

When using elevated ASK mode, the exec approval flow was being bypassed entirely. Commands like crontab that weren't on the allowlist would run without requiring approval.

Root Cause

In bash-tools.exec.ts line 794:

if (elevatedRequested) {
  security = "full";
}

This set security = "full" for all elevated modes (ASK and FULL), not just FULL mode.

Since requiresExecApproval() only requires approval when security === "allowlist":

return (
  params.ask === "always" ||
  (params.ask === "on-miss" &&
    params.security === "allowlist" &&  // <-- "full" ≠ "allowlist"
    (!params.analysisOk || !params.allowlistSatisfied))
);

The approval check was always skipped in ASK mode because security was "full" instead of "allowlist".

Fix

Only set security = "full" when elevatedMode === "full":

if (elevatedRequested && elevatedMode === "full") {
  security = "full";
}

This allows ASK mode to properly enforce the approval flow for non-allowlisted commands.

Testing

  • Build passes (npm run build)
  • Verified the logic flow through code review

@steipete steipete merged commit fe7436a into openclaw:main Jan 24, 2026
21 of 22 checks passed
@steipete
Copy link
Contributor

Landed via temp rebase onto main.\n\n- Gate: pnpm lint && pnpm build && pnpm test\n- Land commit: fe7436a\n- Merge commit: fe7436a\n\nThanks @ivancasco!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants