Openclaw cli: OpenClaw's TOCTOU symlink race in writeFileWithinRoot could create or truncate files outside root boundaries
Description
A time-of-check to time-of-use (TOCTOU) symlink race condition exists in OpenClaw CLI's writeFileWithinRoot function. This vulnerability allows an attacker to manipulate a symlink path between resolution and file write operations, potentially causing file creation or truncation outside the intended root directory. The issue affects versions up to 2026.2.26 and is fixed in version 2026.3.1 by changing the file write flow to include post-open identity and boundary checks and exclusive file creation semantics.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
OpenClaw CLI versions up to 2026.2.26 contain a TOCTOU symlink race in the writeFileWithinRoot function. An attacker can exploit this race condition by retargeting a symlink after the path resolution but before the write operation, causing files to be created or truncated outside the configured root directory. The fix in version 2026.3.1 modifies the write flow to open existing files without pre-truncation, create missing files exclusively, truncate only after verifying file identity and boundaries, and remove any out-of-root artifacts if a race is detected.
Potential Impact
Exploitation of this vulnerability can result in unauthorized file creation or truncation outside the intended root directory, potentially leading to data loss or unauthorized modification of files. This could undermine system integrity by allowing writes to arbitrary filesystem locations.
Mitigation Recommendations
A patch is available in OpenClaw CLI version 2026.3.1 that addresses this TOCTOU symlink race. Users should upgrade to version 2026.3.1 or later to mitigate this vulnerability. No additional mitigation steps are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-openclaw-cli-GHSA-x82f-27x3-q89c
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 4.0
Threat ID: 6ac2458012601ec6a3164068
Added to database: 10/04/2026, 12:24:32 UTC
Last enriched: 10/04/2026, 12:29:09 UTC
Last updated: 10/04/2026, 12:29:09 UTC
Views: 1
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.