NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-32056: OpenClaw's shell startup env injection bypasses system.run allowlist intent (RCE class)

highCVSS 4.0 7.7 · 3.1 7.5GHSA-xgf2-vxv2-rrmg

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 openclaw

Also 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_profile
  • ZDOTDIR + 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 HOME or ZDOTDIR makes the shell read an attacker's .bash_profile or .zshenv before 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 entries