CVE-2026-32056: OpenClaw's shell startup env injection bypasses system.run allowlist intent (RCE class)
OpenClaw 2026.2.21-2 and earlier let `system.run` requests override `HOME` and `ZDOTDIR`, so a shell loads attacker-controlled startup files such as `.bash_profile` or `.zshenv` before the allowlisted command runs. Upgrade to openclaw 2026.2.22.
Published Mar 3, 2026 · Updated Mar 30, 2026 · Analysis Oct 31, 2026
What an attacker can do
system.run in allowlist mode analyzes the command body of a shell wrapper such as bash -lc or zsh -c. It does not model what the shell does at startup. The env sanitizer blocked many dangerous keys but not HOME or ZDOTDIR. A request could point HOME at a directory holding a malicious .bash_profile, or ZDOTDIR at one holding a .zshenv. The shell then runs that file first, with no allowlist check.
The advisory lists two working vectors: HOME with bash -lc and a malicious .bash_profile, and ZDOTDIR with zsh -c and a malicious .zshenv. The attacker needs to place the startup file somewhere the host can read and to be able to send a system.run request with an env object. The CVSS vectors call for low privileges and high attack complexity.
The result is arbitrary command execution on the host with the OpenClaw user's rights, so an allowlist meant to confine an agent to a few commands does not confine it. This is the same class as the SHELLOPTS/PS4 bypass in CVE-2026-32003.
Who is affected
openclaw (npm) versions up to and including 2026.2.21-2. The flaw applies to system.run in allowlist mode when a request can carry an env override and the command is run through a shell wrapper.
npm ls openclawAlso review who can invoke system.run and whether they can write files to a location the host can read.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.2.22
- Fixed in
- 2026.2.22
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.2.22:
npm install [email protected]The fix adds a shared list of blocked override keys, HOME and ZDOTDIR, to the Node and macOS host env sanitizers. Request overrides for those keys are dropped and the trusted base values stay. PATH overrides remain blocked, as do BASH_ENV and the DYLD_, LD_ and BASH_FUNC_ prefixes. The sources list no workaround.
How to tell if you were hit
Look in system.run request logs for an env containing HOME or ZDOTDIR. On the host, search for .bash_profile, .zshenv or similar startup files in unusual directories such as temp or workspace paths, and for child processes that started before the allowlisted command. Beam records agent shell commands and flags risky ones, which can expose a startup-file payload that runs as a shell command.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
system.run environment sanitization allowed shell-startup env overrides (HOME, ZDOTDIR) that can execute attacker-controlled startup files before allowlist-evaluated command bodies.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected:
<= 2026.2.21-2(latest published vulnerable version) - Planned patched version:
>= 2026.2.22
Technical Details
In affected versions:
- Env sanitization blocked many dangerous keys, but not startup-sensitive override keys (
HOME,ZDOTDIR) in host exec env paths. - Shell-wrapper analysis for allowlist mode models command bodies, but not shell startup side effects.
- Runtime execution used sanitized env, so attacker-provided startup-key overrides could run hidden startup payloads first.
Observed exploit vectors:
HOME+bash -lc+ malicious.bash_profileZDOTDIR+zsh -c+ malicious.zshenv
Fix Commit(s)
c2c7114ed39a547ab6276e1e933029b9530ee906
Release Process Note
patched_versions is pre-set to the planned next release (>= 2026.2.22). After the npm release is published, this advisory can be published directly.
OpenClaw thanks @tdjackey for reporting.
Credited to tdjackey.
Questions
- How does CVE-2026-32056 bypass the allowlist?
The allowlist inspects the command body, but the shell runs startup files first. Overriding
HOMEorZDOTDIRmakes the shell read an attacker's.bash_profileor.zshenvbefore that body.- Are the trusted HOME and ZDOTDIR values still used?
Yes. After the fix, request overrides for those two keys are skipped and the base environment values are used.
- Which version fixes it?
openclaw 2026.2.22. Versions up to 2026.2.21-2 are affected.
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
