CVE-2026-41380: OpenClaw gateway exec allow-always over-trusts positional carrier executables
OpenClaw up to 2026.3.24 could save an "allow-always" exec approval for a wrapper such as env or bash instead of the command actually approved. A later command routed through that wrapper then runs without a prompt. Upgrade to 2026.3.28.
Published Apr 1, 2026 · Updated Apr 28, 2026 · Analysis Nov 7, 2026
What an attacker can do
OpenClaw's gateway asks an operator to approve shell commands an agent wants to run. Choosing allow-always stores an allowlist pattern for future runs. When a command went through a dispatch wrapper and the target appeared as a positional argument, the pattern could be built from the carrier executable instead of the real target. The logic is in resolveShellWrapperPositionalArgvCandidatePath in src/infra/exec-approvals-allowlist.ts (CWE-863).
One approval then became a broader standing rule than the operator meant. The fix commit's tests show the danger: with env as the carried target, a later env command that sets BASH_ENV was not covered by the old persisted pattern. With bash as the carried target, a later bash -lc 'id > /tmp/pwned' could slip past the allowlist. Trailing arguments of a wrapper can change what runs.
The attacker needs a local foothold: they must get an agent or prompt to trigger an approved wrapper-routed command, and an operator must click allow-always. After that, the agent can run arbitrary commands under the gateway user.
Who is affected
The openclaw npm package, 2026.3.24 and earlier. Version 2026.3.28 contains the fix. Operators who use allow-always on exec approvals are the ones exposed. Existing allowlist entries saved by an affected version may still be too broad.
npm ls openclawopenclaw
- Ecosystem
- npm
- Affected
- <= 2026.3.24
- Fixed in
- 2026.3.28
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.28:
npm install [email protected]The fix commit, "Exec approvals: reject wrapper carrier allow-always targets", makes the allowlist refuse a positional carrier whose carried executable is a dispatch wrapper or a shell wrapper. No allow-always pattern is persisted in that case. Review allowlist entries created before the upgrade and remove any that name env, bash or other wrappers. The sources give no other workaround.
How to tell if you were hit
Open the exec approvals allowlist and look for allow-always entries that name a wrapper such as env, bash or sh. Check gateway exec logs for commands that ran without a prompt and used env with BASH_ENV, or bash -lc with unexpected scripts. Compare each run against what the operator approved.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Allow-always persistence could trust wrapper carrier executables instead of the actual invoked target when commands were routed through dispatch wrappers.
Impact
A one-time approval could persist a broader future allowlist entry than the operator intended, weakening execution approval boundaries.
Affected Component
src/infra/exec-approvals-allowlist.ts
Fixed Versions
- Affected:
<= 2026.3.24 - Patched:
>= 2026.3.28 - Latest stable
2026.3.28contains the fix.
Fix
Fixed by commit 9ec44fad39 (Exec approvals: reject wrapper carrier allow-always targets).
Credited to nexrin, KeenSecurityLab, qclawer.
Questions
- Does one click on allow-always make the whole machine open?
On affected versions it could widen the rule beyond the approved command when it ran through a wrapper. The fix stops saving patterns for wrapper carriers.
- Which version fixes it?
openclaw 2026.3.28. Versions up to 2026.3.24 are listed as affected.
- Do I need to clean up old approvals?
Yes, review them. The upgrade stops new bad entries, and the sources do not say it removes ones already saved.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More OpenClaw vulnerabilities
All OpenClaw entriesCVE-2026-62197
OpenClaw: Browser CDP discovery could accept blocked WebSocket URLs
medium8.5Oct 21, 2026CVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026
