GHSA-w9j9-w4cp-6wgr: OpenClaw Host-Exec Environment Variable Injection
OpenClaw's host exec path could pass environment variables to the commands it runs that change how interpreters, shells or build tools behave. Versions up to 2026.3.28 are affected, and the npm package is fixed in 2026.4.8. The advisory has no CVE id and does not list the variables involved.
Published Apr 9, 2026 · Analysis Oct 30, 2026
What an attacker can do
When OpenClaw runs a command on the host, the child process inherits an environment. Some variables change how a shell, language runtime or build tool starts, for example by loading extra code or altering search paths. The advisory says host exec could inherit such variables. If an attacker can influence the environment that reaches a host exec call, a command the user approved as harmless can run attacker-chosen code.
The weakness is classed as OS command injection (CWE-78), with a local vector, passive attack requirements and high integrity impact only. The advisory names no specific variables and gives no exploit path. The listing of CVSS 4.0 is the only score published (5.9, medium).
The maintainers scope the flaw to OpenClaw's trust model. OpenClaw is a user-controlled local assistant, and the advisory does not assume a multi-tenant service. The realistic exposure is a workstation or server where the agent runs commands for you and some less trusted input, such as a project's environment files, a tool result or a prompt, can set variables for those commands. The sources say no more than this.
Who is affected
The openclaw npm package at 2026.3.28 and earlier; the package data lists everything below 2026.4.8. Check the installed version.
npm ls -g openclaw
openclaw --versionAny setup where OpenClaw runs commands on the host (host exec) is in scope.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.4.8
- Fixed in
- 2026.4.8
- Check
npm ls openclaw
How to fix it
Upgrade to 2026.4.8.
npm install -g [email protected]The fix is on main in commit d7c3210cd6f5fdfdc1beff4c9541673e814354d5, with regression tests for the boundary, according to the advisory. The advisory gives no workaround. Until you upgrade, avoid running OpenClaw host exec in directories or sessions where untrusted content can set environment variables.
How to tell if you were hit
The advisory gives no indicators. Review the environment of OpenClaw's host-exec child processes for unexpected variables that change interpreter or shell startup. Look in shell history and process trees for commands that ran extra code before the intended command. Check dotenv-style files and shell profile files in project directories for entries you did not write. Beam records agent shell commands, so you can compare what the agent ran with what you expected.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Impact
OpenClaw Host-Exec Environment Variable Injection.
Host exec could inherit environment variables that influence interpreters, shells, or build tools.
OpenClaw is a user-controlled local assistant. This advisory is scoped to the OpenClaw trust model and does not assume a multi-tenant service boundary.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.3.28 - Patched versions:
2026.4.8
Fix
The issue was fixed on main and is available in the patched npm version listed above. The verified fixed tree is commit d7c3210cd6f5fdfdc1beff4c9541673e814354d5.
Verification
The fix was re-checked against main before publication, including targeted regression tests for the affected security boundary.
Credits
Thanks @wsparks-vc for reporting.
Credited to wsparks-vc.
Questions
- Does GHSA-w9j9-w4cp-6wgr have a CVE id?
No. The advisory lists CWE-78 and no CVE.
- Which OpenClaw version fixes it?
2026.4.8. The advisory marks 2026.3.28 and earlier as affected.
- Which environment variables are the problem?
The advisory does not say. It describes variables that influence interpreters, shells or build tools. The linked commit is the place to see exactly what changed.
- Is it exploited in the wild?
No source says so, and no EPSS score is published for it.
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
