CVE-2026-31992: OpenClaw has allowlist exec-guard bypass via env -S
In OpenClaw up to 2026.2.22-2, when /usr/bin/env is on the exec allowlist, a command using env -S 'sh -c ...' passes the allowlist check but runs with shell-wrapper behavior. This lets an unapproved payload run in system.run allowlist mode. Upgrade the npm package openclaw to 2026.2.23.
Published Mar 3, 2026 · Updated Mar 20, 2026 · Analysis Oct 31, 2026
What an attacker can do
env -S splits a single string into separate arguments before running the command. OpenClaw's allowlist analysis treated env -S 'sh -c ...' as an ordinary allowed command, not as a shell wrapper. At runtime the string was split and sh -c ran the payload. The policy analysis and runtime execution disagreed, and the allowlist did not apply to what actually ran.
The precondition is that /usr/bin/env is allowlisted, which is common because many scripts start with it. An attacker also needs to influence tool input. The advisory says authenticated Gateway callers are trusted operators by design, and the realistic route is untrusted content steering the agent, such as a prompt injection in a page or file the agent reads.
The maintainers rate this medium because it weakens an operator safety control and is not an authentication break. The CVSS 4.0 vector has low impact on confidentiality, integrity and availability and requires low privileges. Commands run with the permissions of the OpenClaw process.
Who is affected
npm package openclaw, versions up to and including 2026.2.22-2 (the data lists everything before 2026.2.23). It matters when exec runs in allowlist mode with /usr/bin/env on the allowlist. Check:
npm ls openclawThen review your allowlist for env.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.2.23
- Fixed in
- 2026.2.23
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.2.23 or later.
npm install [email protected]Two commits fix it: a1c4bf07c6baad3ef87a0e710fe9aef127b1f606 brings allowlist analysis and runtime behavior into parity, and 3f923e831364d83d0f23499ee49961de334cf58b adds explicit env -S regression tests. The advisory gives no workaround. Removing /usr/bin/env from the allowlist avoids the path on older versions.
How to tell if you were hit
Search agent exec logs for env invocations with -S (or --split-string) followed by sh -c or another shell. Check for shell child processes whose parent command line is an env allowlisted entry. Beam records the shell commands agents run and flags risky ones, which helps find env -S use.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
In allowlist mode, system.run guardrails could be bypassed through env -S, causing policy-analysis/runtime-execution mismatch for shell wrapper payloads.
Severity Rationale (Medium)
This issue is rated medium because it is a guardrail/policy bypass in OpenClaw's trusted-operator model, not an authentication boundary break.
- Authenticated Gateway callers are trusted operators by design.
execapprovals/allowlists are operator safety controls.- The bug still weakens expected safety behavior and can enable unintended command execution when untrusted content influences tool input.
Affected Packages / Versions
- Package:
openclaw(npm) - Vulnerable versions:
<= 2026.2.22-2 - Patched versions:
>= 2026.2.23
Latest published npm version checked during triage: 2026.2.22-2.
Technical Impact
When /usr/bin/env is allowlisted, env -S 'sh -c ...' could be treated as allowed non-wrapper argv while runtime still executes shell-wrapper semantics.
Fix Commit(s)
a1c4bf07c6baad3ef87a0e710fe9aef127b1f606(core allowlist/runtime parity hardening)3f923e831364d83d0f23499ee49961de334cf58b(explicitenv -Sregressions)
Release Process Note
patched_versions is pre-set to >= 2026.2.23, so this advisory is now public.
OpenClaw thanks @tdjackey for reporting.
Credited to tdjackey.
Questions
- Do I need /usr/bin/env on my allowlist to be affected?
Yes. The advisory describes the bypass as happening when /usr/bin/env is allowlisted, since env -S was treated as an allowed non-wrapper command.
- Is CVE-2026-31992 an authentication bypass?
No. The maintainers call it a guardrail bypass inside the trusted-operator model. Authenticated Gateway callers are trusted by design, but untrusted content could still steer tool input.
- Which version fixes the env -S bypass?
openclaw 2026.2.23. Versions up to 2026.2.22-2 are vulnerable.
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
