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

CVE-2026-42435: OpenClaw: Shell-wrapper detection missed env-argv assignment injection forms

mediumCVSS 4.0 6.3GHSA-j6c7-3h5x-99g9

OpenClaw from 2026.2.22 up to 2026.4.12 had gaps in the exec preflight check: it missed some shell-wrapper forms and environment assignments placed in the argument vector. Those could change how a command runs, including through shell controls like `SHELLOPTS` and `PS4`. Upgrade the `openclaw` npm package to 2026.4.12 or later.

Published Apr 17, 2026 · Updated May 5, 2026 · Analysis Oct 29, 2026

What an attacker can do

Before OpenClaw runs a command, a preflight step inspects it and applies the host environment security policy. Two things slipped through. The check did not recognize some shell wrappers, and it did not catch environment assignments written as arguments, for example in an env-style argument form. The advisory gives no concrete examples, so I do not show a payload.

The risk is in the variables. Bash reads SHELLOPTS to switch shell options, and it expands PS4 when tracing is on. Both can influence execution semantics, and PS4 can run command substitutions. The advisory calls these high-risk shell controls that the host environment policy now covers (CWE-78, OS command injection).

The CVSS 4.0 vector is network, high complexity, no privileges, with low integrity impact. The score is medium (6.3). In practice, it means a command that looked allowed by the preflight could run with altered shell behavior. Teams that let an agent or remote user trigger exec under an allowlist or approval policy are the ones to patch.

Who is affected

The openclaw npm package from 2026.2.22 up to, but not including, 2026.4.12. Check the installed version:

npm ls -g openclaw

Versions before 2026.2.22 are outside the advisory range.

openclaw

Ecosystem
npm
Affected
>= 2026.2.22, < 2026.4.12
Fixed in
2026.4.12
Check
npm ls openclaw

How to fix it

Upgrade to 2026.4.12 or newer. The advisory says 2026.4.14, the latest release it names, includes the fix.

npm install -g openclaw@latest

The change (PR #65717, commit 8f8492d) broadens shell-wrapper detection and blocks environment assignments in argv forms. SHELLOPTS and PS4 fall under the host environment security policy. The advisory lists no workaround.

How to tell if you were hit

Review exec logs on affected versions for commands that carry SHELLOPTS= or PS4= assignments, or that call env or a shell wrapper with variable assignments in the arguments. Check for unexpected shell trace output (lines starting with the PS4 prefix) in command output. The advisory gives no log signature.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Shell-wrapper detection missed env-argv assignment injection forms.

Affected Packages / Versions

  • Package: openclaw
  • Ecosystem: npm
  • Affected versions: >= 2026.2.22 < 2026.4.12
  • Patched versions: >= 2026.4.12

Impact

Exec preflight handling missed shell-wrapper and argv-level environment assignment forms that could affect execution semantics, including high-risk shell environment controls.

Technical Details

The fix broadens shell-wrapper detection and blocks environment assignments in argv forms. High-risk shell variables such as SHELLOPTS and PS4 are covered by the host environment security policy.

Fix

The issue was fixed in #65717. The first stable tag containing the fix is v2026.4.12, and [email protected] includes the fix.

Fix Commit(s)

  • 8f8492d172f4c5b4fd7dd9a47855ed620c8770ab
  • PR: #65717

Release Process Note

Users should upgrade to openclaw 2026.4.12 or newer. The latest npm release, 2026.4.14, already includes the fix.

Credits

Thanks to @decsecre583 for reporting this issue.

Questions

Which OpenClaw versions does CVE-2026-42435 affect?

Versions from 2026.2.22 up to, but not including, 2026.4.12. The fix is in 2026.4.12, and 2026.4.14 includes it.

What did the preflight miss?

Shell-wrapper forms and argv-level environment assignments. The advisory names SHELLOPTS and PS4 as high-risk variables now covered by the host environment policy.

Is there a workaround?

The advisory lists none. The only remediation it gives is to upgrade to 2026.4.12 or newer.

Is it exploited in the wild?

No source I read says so, and the entry has no CISA KEV data.

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