CVE-2026-32032: OpenClaw's shell env fallback trusts unvalidated SHELL path from host environment
OpenClaw 2026.2.21-2 and earlier loaded the shell environment by running whatever `SHELL` pointed to, as `$SHELL -l -c 'env -0'`, without checking it. An attacker who controls the startup environment can make OpenClaw run their binary as the shell. Upgrade to openclaw 2026.2.22.
Published Mar 3, 2026 · Updated Mar 25, 2026 · Analysis Oct 31, 2026
What an attacker can do
OpenClaw's shell-env fallback imports the user's login environment by launching $SHELL -l -c 'env -0'. Affected builds took SHELL from the host environment as given. If SHELL named an attacker-controlled executable, OpenClaw ran it with the user's rights.
The advisory says this is not a remote pre-auth path. The attacker first needs local environment compromise or a way to inject values into OpenClaw's startup environment, such as a service unit, a container spec or a launcher script. A related route was config and skill-level env overrides: the patch also adds SHELL to the dangerous env-var policy so those cannot set it.
The result is arbitrary code execution as the OpenClaw user, with high confidentiality, integrity and availability impact in the CVSS vectors. The attack is local and needs low privileges.
Who is affected
openclaw (npm) versions up to and including 2026.2.21-2. Any host where the shell-env fallback runs and SHELL can be influenced by someone other than the user is exposed.
npm ls openclaw
echo $SHELLThe SHELL value should be an absolute path listed in /etc/shells.
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 accepts SHELL only when it is an absolute, normalized path. The path must be listed in /etc/shells, or must sit under a trusted prefix and be executable. Trusted prefixes are /bin/, /usr/bin/, /usr/local/bin/, /opt/homebrew/bin/ and /run/current-system/sw/bin/. If validation fails, OpenClaw runs /bin/sh -l -c "env -0" instead. The host env policy now blocks SHELL overrides from config env vars and skills.
How to tell if you were hit
Check the environment of the OpenClaw process, for example in its service definition, for a SHELL value outside /etc/shells. Look for processes started by OpenClaw whose executable is not a known shell, and for SHELL entries in OpenClaw config env or skill env settings. Beam records agent shell commands, so unexpected shell invocations by the agent host can be spotted.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
The shell environment fallback path could invoke an attacker-controlled shell when SHELL was inherited from an untrusted host environment. In affected builds, shell-env loading used $SHELL -l -c 'env -0' without validating that SHELL points to a trusted executable.
In threat-model terms, this requires local environment compromise or untrusted startup environment injection first; it is not a remote pre-auth path. The hardening patch validates SHELL as an absolute normalized executable, prefers /etc/shells, applies trusted-prefix fallback checks, and falls back safely to /bin/sh when validation fails. The dangerous env-var policy now also blocks SHELL overrides.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.2.21-2 - Latest published vulnerable version:
2026.2.21-2 - Patched versions (planned next release):
>= 2026.2.22
Fix Commit(s)
25e89cc86338ef475d26be043aa541dfdb95e52a
Release Process Note
The advisory pre-sets patched_versions to the planned next release (2026.2.22). After that npm release is published, maintainers can publish this advisory without further version-field edits.
OpenClaw thanks @athuljayaram for reporting.
Credited to athuljayaram.
Questions
- Can CVE-2026-32032 be exploited remotely?
Not directly. The advisory says it needs local environment compromise or untrusted startup environment injection first, and is not a remote pre-auth path.
- What happens when SHELL is invalid after the fix?
OpenClaw falls back to
/bin/sh. A relative value likezshand an untrusted path like/tmp/evil-shellare both rejected in the tests.- 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
