CVE-2026-35650: OpenClaw has Inconsistent Host Exec Environment Override Sanitization
OpenClaw before 2026.3.22 applied its host environment policy inconsistently to environment overrides on host exec. Blocked or malformed keys could pass through some code paths and reach the spawned command. A caller with low privileges could use this to change how a host command runs. Upgrade openclaw to 2026.3.22 or later.
Published Mar 26, 2026 · Updated Apr 10, 2026 · Analysis Oct 31, 2026
What an attacker can do
OpenClaw can run commands on the gateway or a node host, and the caller can supply environment variable overrides. A shared host environment policy lists variables that must not be overridden, because variables such as PATH or loader and interpreter settings change which code a command loads. Before the fix, the gateway exec tool and the node run path each sanitized overrides in their own way, so blocked or malformed keys could slip through one of them (CWE-15 and CWE-693).
An attacker needs access to the agent or gateway with low privileges (PR:L) and has to craft the override. High attack complexity (AC:H) in the CVSS vector reflects that. A successful override can redirect a command to attacker-chosen binaries, config or libraries, which gives code execution on the host with the gateway's rights.
This matters most where an AI agent or a prompt-injected session can request host exec and set env values, and where approvals or allowlists assume the command environment is clean.
Who is affected
Affected: the openclaw npm package before 2026.3.22, on installs where host exec (gateway or node host) is in use. Sandboxed runs use a separate environment path. Check the version:
npm ls openclaw
openclaw --versionopenclaw
- Ecosystem
- npm
- Affected
- < 2026.3.22
- Fixed in
- 2026.3.22
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.22 or later; 2026.3.23 and 2026.3.23-2 keep the fix.
npm install -g openclaw@latestFix commit 7abfff756d6c68d17e21d1657bbacbaec86de232 adds one shared sanitizer in src/infra/host-env-security.ts, used by src/agents/bash-tools.exec.ts and src/node-host/invoke-system-run.ts. Any blocked or invalid override now fails the call before execution. The commit also adds 16 keys to the blocked list, including CLASSPATH, GOFLAGS, PHPRC, LUA_PATH, GEM_HOME and XDG_CONFIG_HOME, and rejects a custom PATH. No workaround is listed.
How to tell if you were hit
After patching, rejected attempts show in logs and tool errors as "Security Violation: Environment variable 'KEY' is forbidden during host execution" or "Custom 'PATH' variable is forbidden during host execution". The macOS node reports "SYSTEM_RUN_DENIED: environment override rejected". Search older logs and session records of host exec calls for env overrides that set PATH or the keys above. A pattern of such attempts, before upgrading, means the filter may have been bypassed.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Gateway host exec env override handling did not consistently apply the shared host environment policy, so blocked or malformed override keys could slip through inconsistent sanitization paths.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected: < 2026.3.22
- Fixed: >= 2026.3.22
- Latest released tag checked:
v2026.3.23-2(630f1479c44f78484dfa21bb407cbe6f171dac87) - Latest published npm version checked:
2026.3.23-2
Fix Commit(s)
7abfff756d6c68d17e21d1657bbacbaec86de232
Release Status
The fix shipped in v2026.3.22 and remains present in v2026.3.23 and v2026.3.23-2.
Code-Level Confirmation
- src/infra/host-env-security.ts now provides one shared sanitizer and fail-closed diagnostics for blocked or malformed override keys.
- src/agents/bash-tools.exec.ts and src/node-host/invoke-system-run.ts both route env overrides through the shared sanitizer before execution.
OpenClaw thanks @zpbrent for reporting.
Credited to zpbrent.
Questions
- Which OpenClaw versions are fixed for CVE-2026-35650?
2026.3.22 is the first fixed release. The fix is also in 2026.3.23 and 2026.3.23-2. Anything older is vulnerable.
- Is a remote unauthenticated attack possible?
The CVSS vector needs low privileges (PR:L) and high complexity (AC:H) over the network. An attacker needs some access to submit host exec requests.
- What does the patched OpenClaw do with a blocked key?
It throws before running the command and names the blocked or non-portable keys. It no longer lets some paths pass them through.
- Is it exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog. The EPSS score is 0.0049.
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
