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

CVE-2026-41296: OpenClaw: Sandbox escape via TOCTOU race in remote FS bridge readFile

criticalCVSS 4.0 9.4 · 3.1 8.2GHSA-9p3r-hh9g-5cmg

OpenClaw up to 2026.3.28 has a time-of-check to time-of-use race in the remote sandbox filesystem bridge. The readFile path checks a path, then reads the file in a separate step, so an attacker can swap the target in between and read files outside the sandbox. Upgrade to 2026.3.31.

Published Apr 3, 2026 · Updated Apr 24, 2026 · Analysis Oct 30, 2026

What an attacker can do

The remote FS bridge in src/agents/sandbox/remote-fs-bridge.ts served reads in several steps: resolve the canonical path, check for hardlinks, then run cat on the path. Between the check and the read, the path can change. If code inside the sandbox can replace a checked path with a symlink that points outside the workspace, the later cat follows it and returns a host file.

That is a sandbox escape. The sandbox is the control that limits what an agent, or a prompt-injected agent, can read. The attacker needs the ability to run code or file operations inside the sandbox, which the CVSS vector reflects as low privileges, and has to win a race, which is why the 3.1 vector rates complexity as high. The result is disclosure of host files such as credentials, tokens and source code, and the changed scope in the vector reflects that the damage reaches beyond the sandbox.

Who is affected

The npm package openclaw, versions 2026.3.28 and earlier. The maintainers' triage says the sandbox reads in v2026.3.28 still did the path check and the read separately. Setups that use the remote sandbox filesystem bridge are the exposed ones. Check the installed version:

npm ls openclaw
openclaw --version

openclaw

Ecosystem
npm
Affected
<= 2026.3.28
Fixed in
2026.3.31
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.3.31, the first stable tag with the fix.

npm install -g [email protected]

The fix commit makes readFile pin the parent directory and open the file in one step inside the Python mutation helper. The helper opens the target relative to a directory file descriptor, rejects anything that is not a regular file, and rejects files with more than one hard link. Reads of symlinks are rejected too, including ones that point inside the workspace. No workaround is given.

How to tell if you were hit

Look for symlinks or hard links created inside sandbox workspaces that point to paths outside them, particularly ones that appear and vanish quickly. Review agent file reads that returned content from locations such as home directories, SSH keys or environment files. Compare sandbox read logs against the paths the task should have needed. Beam records agent file access and shell commands, so its rules can flag a read of a sensitive path outside the project.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

Sandbox escape via TOCTOU race in remote FS bridge readFile

Current Maintainer Triage

  • Normalized severity: critical
  • Assessment: v2026.3.28 remote sandbox reads still do path-check then separate file read, so the TOCTOU sandbox escape remains present in the latest shipped tag.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published npm version: 2026.3.31
  • Vulnerable version range: <=2026.3.28
  • Patched versions: >= 2026.3.31
  • First stable tag containing the fix: v2026.3.31

Fix Commit(s)

  • 121870a08583033ed6a0ed73d9ffea32991252bb — 2026-03-31T09:55:51+09:00

OpenClaw thanks @AntAISecurityLab for reporting.

Credited to AntAISecurityLab.

Questions

Which OpenClaw version fixes the readFile race?

2026.3.31. Versions up to and including 2026.3.28 are vulnerable. The fix commit is 121870a, dated 2026-03-31.

What is the race exactly?

The old code checked the resolved path and hard links, then ran cat as a separate step. A path swapped between those steps escapes the sandbox check.

Is it exploited in the wild?

The sources do not say so. The advisory was reported by AntAISecurityLab and the entry has no CISA KEV data.

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