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

GHSA-796m-2973-wc5q: OpenClaw has exec allowlist/safeBins policy-runtime mismatch via env -S wrapper interpretation

mediumCVSS 4.0 5.7

OpenClaw's `tools.exec` allowlist and safe-bins check could be bypassed with a GNU `env -S/--split-string` wrapper. The policy saw a harmless safe-bin command while the runtime ran a different payload. Anyone whose prompt or content can reach an exec-capable OpenClaw flow is exposed. Upgrade the `openclaw` npm package to 2026.2.23.

Published Mar 3, 2026 · Analysis Oct 31, 2026

What an attacker can do

The exec approval code unwrapped dispatch wrappers such as env to find the real executable, then judged that executable against the allowlist or safe-bins list. The runtime could still run the original wrapper argv. With env -S, GNU env splits a string into new arguments, so the command the policy judged and the command that ran were not the same. The root cause is an interpretation conflict (CWE-436). A second gap let safe-bin short-flag handling accept unknown short options inside clusters.

An attacker does not need shell access. They need to influence the command text the agent produces, for example through prompt injection in a web page, issue or file that reaches an exec-capable flow. A command shaped like an approved safe bin, such as env -S 'sh -c ...' tr, then runs something else. The result is execution of commands the operator never allowed, with the privileges of the OpenClaw process. The CVSS 4.0 vector is local, with low privileges and an attack-requirements condition, and high integrity impact.

Who is affected

Affected: the openclaw npm package at 2026.2.22-2 and earlier, which the advisory describes as the latest published version when it was written. Setups that rely on the exec allowlist or safe-bins to limit what the agent can run are the ones that lose protection.

Check your install:

npm ls openclaw

For a global install, use npm ls -g openclaw.

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:

npm install [email protected]

The fix (commit a1c4bf07) makes exec approvals fail closed and keeps analysis and runtime identical. It plans wrapper execution and blocks wrappers with semantic options such as env -S. It evaluates the allowlist against the planned argv, and runs a canonical command rebuilt from that plan with the resolved absolute executable. It also rejects unknown short safe-bin flags. The advisory gives no workaround.

How to tell if you were hit

Review exec logs and shell history for commands that start with env and use -S or --split-string, and for env calls with variable assignments that precede a safe-bin name. Look for child processes of the OpenClaw gateway or node host that are not on your allowlist, such as sh -c. After the fix, a blocked attempt is denied by policy, with the message exec denied: allowlist execution plan unavailable possible when the plan cannot be built.

If Beam hooks are connected to your agents, its record of agent shell commands lets you search for these env -S invocations afterwards.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

tools.exec allowlist/safe-bins evaluation could diverge from runtime execution for wrapper commands using GNU env -S/--split-string semantics. This allowed policy checks to treat a command as a benign safe-bin invocation while runtime executed a different payload.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Vulnerable versions: <= 2026.2.22-2 (latest currently published npm version)
  • Patched version (released): 2026.2.23

Impact

An attacker able to influence tool command text (for example via untrusted prompt/content injection reaching an exec-capable flow) could bypass allowlist/safe-bins intent and execute unexpected commands.

Technical Details

Root cause was policy/runtime interpretation mismatch for dispatch wrappers:

  • analysis resolved an effective executable from wrapper-unwrapped argv,
  • execution could still run original wrapper argv semantics,
  • safe-bin short-flag handling also allowed unknown short options in clusters.

Remediation

The fix hardens exec approvals to fail closed and enforce analysis/runtime parity:

  • introduce wrapper execution planning with semantic-wrapper blocking,
  • carry planned effectiveArgv + policyBlocked metadata through resolution,
  • evaluate allowlist/safe-bins against planned argv,
  • enforce canonical rebuilt shell command from planned argv for allowlist auto-paths,
  • use planned argv for node-host/mac exec-host invocation paths,
  • reject unknown short safe-bin flags,
  • add regression tests for semantic env wrappers and parity fixtures.

Fix Commit(s)

  • a1c4bf07c6baad3ef87a0e710fe9aef127b1f606

Release Process Note

patched_versions is pre-set to the released version (2026.2.23). Patched in 2026.2.23 and published.

OpenClaw thanks @jiseoung for reporting.

Credited to jiseoung.

Questions

Does the OpenClaw env -S bypass need local access?

Not directly. The attacker needs to influence the command text the agent runs, for example via untrusted prompt or content injection reaching an exec-capable flow. The CVSS 4.0 vector marks the attack as local with low privileges.

Which OpenClaw version fixes GHSA-796m-2973-wc5q?

2026.2.23. Versions up to and including 2026.2.22-2 are vulnerable.

Does a strict allowlist protect me?

Not before the fix. The allowlist judged a different command from the one that ran when an env -S wrapper was used. Patch first, then keep the allowlist narrow.

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