OpenClaw Time-of-Check-Time-of-Use Vulnerability in Sandbox File Operations
Vulnerability
A time-of-check-time-of-use (TOCTOU) vulnerability has been identified in OpenClaw versions prior to 2026.3.31. This vulnerability exists within sandbox file operations, allowing attackers to bypass file descriptor-based defenses. By exploiting check-then-act patterns in the 'apply_patch', 'remove', and 'mkdir' operations, attackers can manipulate files between the validation and execution stages.
Impact
Exploitation of this vulnerability allows for general file manipulation within the sandbox, potentially leading to unauthorized file modifications or deletions.
Reproduction
The vulnerability can be reproduced by creating a patch that includes file operations such as adding, deleting, or modifying files. This patch can be applied using the 'apply_patch' operation, which will process the file changes. Due to the TOCTOU nature of the vulnerability, the 'apply_patch' operation can be manipulated to bypass the sandbox's file operation safeguards, leading to unintended file modifications or deletions.
Remediation
Users can update to OpenClaw version 2026.3.31 or later, where this vulnerability has been patched.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
