CVE-2026-4040: OpenClaw safeBins file-existence oracle information disclosure
OpenClaw's `tools.exec.safeBins` approval flow behaved differently depending on whether a candidate file path existed on the host, giving a file-existence oracle. A low-privilege caller can probe for secrets and config files. Versions up to 2026.2.17 are affected; the package data lists 2026.2.19 as patched.
Published Feb 19, 2026 · Updated Mar 12, 2026 · Analysis Oct 31, 2026
What an attacker can do
tools.exec.safeBins is an allowlist of commands that can run without full approval. While validating a safe-bin command, the policy examined file path arguments and the allow or deny result changed depending on whether the path already existed. By trying commands with different file names and comparing outcomes, a caller could tell which files exist (CWE-203, observable discrepancy).
The attacker needs access to the execution surface, which the CVSS vector counts as low privileges, and no user interaction. What they learn is file presence only, not contents. That is enough to enumerate a filesystem, find secrets and config files such as key files, and plan the next step. Impact is therefore limited to low confidentiality.
This matters most where less-trusted users or an injected prompt can reach the agent's exec tool.
Who is affected
The openclaw npm package at <= 2026.2.17 is affected, in setups that use tools.exec.safeBins. Check the version:
npm ls openclawThe advisory text names 2026.2.18 as the planned fix; the package data lists 2026.2.19 as patched.
openclaw
- Ecosystem
- npm
- Affected
- <= 2026.2.17
- Fixed in
- 2026.2.19
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.2.19.
npm install [email protected]The fix makes safe-bin validation deterministic and argv-only, with no host file-existence checks. File-oriented flags are blocked in safe-bin mode, for example sort -o, jq -f and grep -f, and the trusted-path checks stay in place. No workaround is given.
How to tell if you were hit
Look in exec logs for runs of safe-bin commands such as sort, jq or grep with many different file path arguments in a short time, especially paths like .env, key files or cloud credentials, and repeated allow or deny outcomes. Beam records the shell commands an agent runs, so a burst of probing commands would show in its log.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
An information disclosure vulnerability in OpenClaw's tools.exec.safeBins approval flow allowed a file-existence oracle.
When safe-bin validation examined candidate file paths, command allow/deny behavior could differ based on whether a path already existed on the host filesystem. An attacker could probe for file presence by comparing outcomes for existing vs non-existing filenames.
Affected Packages / Versions
- Package:
openclaw(npm) - Affected versions:
<= 2026.2.17 - Latest published vulnerable version at triage time:
2026.2.17 - Planned patched version:
2026.2.18
Impact
Attackers with access to this execution surface could infer whether specific files exist (for example secrets/config files), enabling filesystem enumeration and improving follow-on attack planning.
Fix
The safe-bin policy was changed to deterministic argv-only validation without host file-existence checks. File-oriented flags are blocked for safe-bin mode (for example sort -o, jq -f, grep -f), and trusted-path checks remain enforced.
Fix Commit(s)
bafdbb6f112409a65decd3d4e7350fbd637c7754
Found using MCPwner
Thanks @nedlir for reporting.
Credited to nedlir.
Questions
- Does this expose file contents?
No. The oracle reveals only whether a file exists, which helps enumeration and follow-on attacks.
- Which flags does the fix block?
File-oriented flags in safe-bin mode, for example
sort -o,jq -fandgrep -f.- Is CVE-2026-4040 exploited in the wild?
No source reports exploitation, and it is not in CISA's KEV catalog.
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
