CVE-2026-31997: OpenClaw: system.run approvals did not bind PATH-token executable identity, enabling post-approval executable rebind
For OpenClaw `host=node` runs, `system.run` approvals did not pin which executable a bare command name such as `tr` meant. If PATH resolution changed after approval, a different binary could run than the one the operator approved. Versions before 2026.3.1 are affected. Upgrade the `openclaw` npm package to 2026.3.1.
Published Mar 2, 2026 · Updated Mar 19, 2026 · Analysis Oct 31, 2026
What an attacker can do
Approvals checked the command context, but for tokens in argv[0] that are not paths, they did not record which file the name resolved to. The node resolved the name again at execution time. Anyone who could change what the name resolves to between approval and execution, for example by putting a same-name file in an earlier PATH directory, got their binary run instead (CWE-367 and CWE-426). The operator saw and approved tr, and something else ran.
The attacker needs a way to alter PATH resolution on the node: write access to a directory on its PATH, or control over the environment of the run. The timing window sits between approval and execution. The result is execution of a binary the operator never approved, with the node host's privileges.
The sources disagree on severity. The GitHub advisory scores it 8.7 with a network vector. VulnCheck lists 4.4 (medium) with a local vector, high complexity and user interaction. Neither reports exploitation in the wild.
Who is affected
Affected: the openclaw npm package before 2026.3.1 (the advisory text names 2026.2.26 and earlier), for host=node runs that use system.run approvals with bare command names. Commands given as full paths are less exposed.
Check the version on the gateway and on each node:
npm ls openclawFor a global install, use npm ls -g openclaw. Use echo $PATH on nodes to find writable entries.
openclaw
- Ecosystem
- npm
- Affected
- < 2026.3.1
- Fixed in
- 2026.3.1
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.1:
npm install [email protected]Node system.run approvals now require immutable systemRunPlan data. Commands given as path tokens are pinned to their canonical executable identity (realpath) across approval and execution, so a later PATH change cannot swap the binary. The advisory lists no workaround. Until you upgrade, make sure no PATH directory on a node is writable by untrusted users or agents.
How to tell if you were hit
On node hosts, check process-creation or auditd logs for the full executable path of approved commands and compare it with the system binary. Run type -a tr (or the relevant command) and look for copies in user-writable directories such as ~/.local/bin. Recent changes to directories on the node's PATH, or to shell profiles that edit PATH, are another indicator.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
For host=node runs, approvals validated command context but did not pin executable identity for non-path-like argv[0] tokens (for example tr). If PATH resolution changed after approval, execution could run a different binary.
Impact
A previously approved action could execute a different executable than the operator approved.
Fix
Node system.run approvals now require immutable systemRunPlan data, and path-token commands are pinned to canonical executable identity (realpath) across approval and execution.
Affected and Patched Versions
- Affected:
<= 2026.2.26 - Patched:
2026.3.1
Credited to tdjackey.
Questions
- What does CVE-2026-31997 change about system.run approvals?
Before the fix, an approval for a bare name like
trdid not fix which file that name meant. A PATH change after approval could swap the executable. Patched versions pin the canonical path.- Does the attacker need access to the node?
They need to change PATH resolution there, for example by writing a same-name file into an earlier PATH directory. The VulnCheck vector lists local access and low privileges.
- Which version fixes it?
2026.3.1. The advisory text names 2026.2.26 and earlier as 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
