Mar 3, 2026·6 min read·20 visits
OpenClaw versions prior to 2026.2.26 contain a race condition in the command approval mechanism. Attackers can gain unauthorized filesystem access by swapping symbolic links in the target directory path after an administrator grants approval but before the command executes. This bypasses security controls intended to restrict agent behavior.
A high-severity Time-of-Check Time-of-Use (TOCTOU) vulnerability exists in the OpenClaw AI assistant framework, specifically within the `system.run` command approval workflow. The flaw allows local attackers or compromised sub-processes to bypass administrator approval restrictions by manipulating symbolic links in the Current Working Directory (CWD) path. By altering filesystem state between the approval phase and the execution phase, an attacker can redirect command execution to unauthorized, sensitive directories (e.g., `/root` or `/etc`) despite the administrator approving a benign path.
OpenClaw acts as an autonomous agent capable of executing system commands via the system.run interface. To maintain security, the framework implements a 'Gateway' pattern where sensitive operations requested by a Node (agent) must be explicitly approved by a human administrator or a policy engine. This approval process relies on inspecting the parameters of the request, specifically the command arguments (argv) and the working directory (cwd).
The vulnerability stems from a Time-of-Check Time-of-Use (TOCTOU) discrepancy in how file paths are handled during this workflow. The system validates the cwd path as a string during the approval phase. However, it does not ensure that the filesystem objects referenced by that path remain static until execution. In a Linux/Unix environment, paths containing symbolic links are resolved dynamically by the kernel at the moment of access. If an attacker can modify the symlink targets after approval is granted, the validation logic becomes irrelevant.
This flaw undermines the core security model of OpenClaw, effectively allowing an agent or a local attacker to trick an administrator into authorizing execution in a sandbox environment, only to have the execution actually occur in a privileged or sensitive directory. This is classified as an Authorization Bypass via Race Condition (CWE-367).
The root cause is the lack of atomicity between the path validation step and the process instantiation step, combined with the presence of mutable symbolic links in the path components. When system.run is invoked, the path is presented to the approver. The approver evaluates the risk based on the path's resolution at that moment. Once approved, the system queues the command for execution.
The execution engine eventually calls the operating system's process spawn primitives (e.g., execve or Node.js child_process.spawn), passing the originally approved string as the cwd. The OS resolves this path at the instant of execution. If any component of that path is a symbolic link that has been modified since the approval, the final destination of the cwd changes.
Specifically, the vulnerability exploits the gap between the Check (Approval) and the Use (Execution). Because the system did not lock the filesystem state or enforce the use of a pre-resolved file descriptor, the path name is merely a pointer that can be retargeted. This is particularly dangerous when the path traverses directories where the attacker has write permissions, allowing them to replace a symlink with a new one pointing to a restricted location.
The remediation involves two major architectural changes: creating immutable execution plans and strictly validating path components for mutable symlinks. The fix was introduced in version 2026.2.26.
Vulnerable Logic (Conceptual): Previously, the system likely accepted a request object, displayed it to the user, and upon approval, passed that same object to the execution handler. There was no verification that the path components were immutable.
Patched Logic:
The fix introduces hasMutableSymlinkPathComponentSync, which recursively checks every segment of the target path. It ensures that no component is a symbolic link residing in a writable directory. If a path relies on a symlink that the current process user can modify (delete/recreate), it is rejected as unsafe.
Below is the critical validation logic added in src/node-host/invoke-system-run-plan.ts (Commit 78a7ff2d50fb3bcef351571cb5a0f21430a340c1):
// Validation: Ensure no component of the path is a mutable symlink
function hasMutableSymlinkPathComponentSync(targetPath: string): boolean {
// Iterate through every directory component from root to target
for (const component of pathComponentsFromRootSync(targetPath)) {
try {
// Check if the component is a symlink
if (!fs.lstatSync(component).isSymbolicLink()) {
continue;
}
// If it is a symlink, check if the PARENT directory is writable
const parentDir = path.dirname(component);
if (isWritableByCurrentProcessSync(parentDir)) {
return true; // REJECT: Attacker could swap this link
}
} catch {
return true; // Fail closed on error
}
}
return false;
}Additionally, the system now uses a systemRunPlanV2 object (Commit 4b4718c8dfce2e2c48404aa5088af7c013bed60b). This plan is generated during a prepare phase where paths are canonicalized. The execution phase strictly adheres to the prepared plan, rejecting any late-bound parameters that differ from the approved plan.
Exploiting this vulnerability requires the attacker to have write access to a directory used in the cwd path of a requested command. The attack follows a standard race condition pattern against the human-in-the-loop approval mechanism.
Prerequisites:
system.run requests (as an agent or user).cwd path.Attack Steps:
/tmp/exploit/safe_target. They then create a symlink /tmp/exploit/link pointing to /tmp/exploit/safe_target.system.run with the command ls -la and cwd set to /tmp/exploit/link./tmp/exploit/link and see it points to a safe, empty directory. They approve the request.rm /tmp/exploit/link
ln -s /root /tmp/exploit/link/tmp/exploit/link. The OS follows the new symlink, executing ls -la inside /root.This technique allows the attacker to execute commands in any directory on the system, bypassing the administrator's intent to restrict the agent to a sandbox.
The impact of this vulnerability is High, as it completely negates the primary security control (human approval) for agentic actions.
Confidentiality: An attacker can execute read commands (e.g., cat, grep) in sensitive directories like /etc, /root, or source code repositories, exfiltrating secrets, keys, or configuration data.
Integrity: If the command allows file modification (e.g., touch, rm, sed), the attacker can corrupt system files, inject backdoors into startup scripts, or modify application code, provided the OpenClaw process has the necessary OS-level permissions.
Availability: An attacker could execute destructive commands in critical system directories, leading to denial of service.
While the attacker is limited by the permissions of the user running the OpenClaw Node, in many deployment scenarios, agents run with significant privileges to perform their automation tasks. The vulnerability bypasses the logical authorization layer, elevating the risk to the full extent of the process's OS capabilities.
The primary remediation is to upgrade the OpenClaw package to version 2026.2.26 or later. This version enforces immutable approval plans and validates the immutability of symlinks in the path.
Immediate Actions:
npm update openclaw or yarn upgrade openclaw to pull the latest patched version.system.run executions that involved paths in temporary directories (e.g., /tmp, /var/tmp) where symlink races are most common.Defense in Depth:
/tmp for execution contexts.| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < 2026.2.26 | 2026.2.26 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-367 (TOCTOU) |
| Attack Vector | Local / Context-Dependent |
| Severity | High |
| CVSS Score | High (N/A) |
| Exploit Status | Conceptual PoC |
| Patch Date | 2026-02-26 |
A vulnerability in the Slack and Mattermost platform adapters for NousResearch hermes-agent permits an unauthenticated remote attacker to execute arbitrary mass mentions. By leveraging prompt injection, an attacker can bypass output sanitization logic and trigger workspace-wide notification exhaustion.
CVE-2026-9306 is a critical unauthenticated Insecure Direct Object Reference (IDOR) vulnerability located in the QuantumNous new-api application, affecting versions up to and including 0.12.1. The flaw is caused by improper middleware ordering combined with a lack of object-level authorization checks. This allows remote, unauthenticated attackers to retrieve sensitive Midjourney images belonging to other users by supplying a valid task identifier.
The instagrapi library prior to version 2.6.9 contains an improper input validation vulnerability within its challenge handling mechanism. Maliciously crafted server responses can manipulate the client into forwarding session cookies and credentials to an external attacker-controlled domain.
GHSA-QQQM-5547-774X is a critical path traversal vulnerability in the FileBrowser Quantum application, specifically within the Go backend package. The vulnerability resides in the HTTP handler responsible for processing bulk file modifications via the public API. Unauthenticated attackers can exploit an order-of-operations flaw in the path sanitization logic to bypass intended directory restrictions. This allows adversaries to arbitrarily read, move, and overwrite files on the underlying filesystem by supplying specially crafted HTTP PATCH requests.
The qs query string parsing and serialization library for Node.js is vulnerable to a synchronous Denial of Service (DoS) attack. The vulnerability manifests as a process-terminating TypeError when processing arrays with null or undefined elements under specific configuration parameters.
The aiosend library prior to version 3.0.6 contains a pre-authentication Denial of Service (DoS) vulnerability in its webhook handling mechanism. The software processes and deserializes incoming JSON payloads before verifying the cryptographic signature, allowing unauthenticated attackers to exhaust server CPU and memory resources by sending large, complex payloads.