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

GHSA-qhrr-grqp-6x2g: OpenClaw's tools.exec.safeBins trusted PATH directories allowed binary shadowing in allowlist mode

mediumCVSS 4.0 6.9

In OpenClaw's exec allowlist mode, `tools.exec.safeBins` trusted directories taken from the gateway's PATH. A binary with a safe-bin name placed in one of those directories could pass the check and run. Versions before 2026.2.22 are affected. Upgrade the `openclaw` npm package to 2026.2.22 and set `tools.exec.safeBinTrustedDirs` if you need extra trusted paths.

Published Mar 3, 2026 · Analysis Oct 31, 2026

What an attacker can do

Safe bins are commands the operator allows without approval, such as rg or tr. Before the fix, the check for where a safe bin may live trusted system defaults plus every directory on the gateway process PATH at startup. Safe-bin execution also passed bare command tokens to the shell, so the shell could resolve a name to a shadowed binary. An attacker who could write a same-name executable into any trusted PATH directory, such as a user-writable ~/.local/bin or a project tool folder, would see it accepted as the safe bin. It then ran with the OpenClaw runtime's privileges.

The weakness is an untrusted search path (CWE-426). The attacker needs a way to place a file in a trusted binary location, either local access or an earlier agent step that writes files. They do not need to approve anything. The CVSS 4.0 vector is local with high integrity impact. The result is command execution that the allowlist was meant to prevent.

Who is affected

Affected: the openclaw npm package before 2026.2.22. The advisory text names 2026.2.21-2 and earlier as vulnerable. Only setups that use allowlist mode and rely on tools.exec.safeBins are exposed, and only if an attacker can influence a directory on the gateway's PATH.

Check the version:

npm ls openclaw

For a global install, use npm ls -g openclaw. Also review the directories on the PATH of the gateway process for entries that non-admin users or agents can write to.

openclaw

Ecosystem
npm
Affected
< 2026.2.22
Fixed in
2026.2.22
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.2.22:

npm install [email protected]

The fix (commit 64b273a7) stops trusting PATH-derived directories. Trusted directories are now the system defaults plus the new tools.exec.safeBinTrustedDirs setting, and PATH entries are never auto-trusted. Safe-bin shell execution is pinned to resolved absolute executable paths. If a safe bin lives in a custom location, add that directory to tools.exec.safeBinTrustedDirs explicitly, and only if it is not writable by untrusted users.

How to tell if you were hit

Find executables with safe-bin names (for example rg or tr) outside the system directories, particularly in user-writable PATH entries, using type -a rg or which -a rg. Check file modification times on those directories. Review exec logs for safe-bin commands whose resolved path differs from the system binary. After upgrading, a safe bin found only in a non-trusted directory no longer qualifies, and the command falls back to normal approval.

Beam's record of agent shell commands and file writes can show an agent dropping a binary into a PATH directory before running it.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

In openclaw allowlist mode, tools.exec.safeBins trusted PATH-derived directories for safe-bin resolution. A same-name binary placed in a trusted PATH directory could satisfy safe-bin checks and execute.

Impact

This is an allowlist bypass in exec policy that can lead to command execution in the OpenClaw runtime context when allowlist mode relies on safe bins and an attacker can influence trusted binary locations.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Vulnerable versions: <= 2026.2.21-2
  • Patched versions: >= 2026.2.22 (planned next release)
  • Latest published npm version at triage time (2026-02-22): 2026.2.21-2

Root Cause

  • Safe-bin trust accepted PATH-derived directories instead of explicit trusted directories.
  • Safe-bin execution used shell command tokens that could resolve to shadowed binaries.

Remediation

  • Stop trusting PATH-derived directories for safe-bin trust.
  • Add explicit tools.exec.safeBinTrustedDirs for opt-in extra trusted paths.
  • Pin safe-bin shell execution to resolved absolute executable paths.

Fix Commit(s)

  • 64b273a71cf0b2f2419c974832cede1fc2158729

Release Process Note

patched_versions is pre-set to the planned next release (2026.2.22). After npm release, this advisory is ready for publish without additional field edits.

OpenClaw thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Does GHSA-qhrr-grqp-6x2g affect me if I do not use allowlist mode?

The advisory describes an allowlist bypass that depends on tools.exec.safeBins in allowlist mode. Without that configuration, this path does not apply.

How do I trust a safe bin in a custom directory after the fix?

Add the directory to tools.exec.safeBinTrustedDirs. PATH entries are no longer trusted automatically, so the opt-in is explicit.

Which version is patched?

2026.2.22. The advisory text lists 2026.2.21-2 and earlier as vulnerable.

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