Mar 4, 2026·6 min read·47 visits
OpenClaw failed to resolve symlinks for paths where the final file (leaf) did not exist. Attackers can exploit this by creating symlinks to sensitive host directories and mounting non-existent files through them, achieving arbitrary file write access on the host.
A critical logic error in OpenClaw's path validation mechanism allows attackers to bypass sandbox restrictions. By requesting bind mounts for non-existent files within symlinked parent directories, attackers can trick the validation logic into accepting paths that resolve to restricted host directories (e.g., /etc or /var). This effectively breaks the security boundary between the sandboxed agent and the host system.
OpenClaw, a platform for personal AI agents, utilizes a sandbox environment to isolate agent operations from the host system. To maintain security, the platform enforces strict validation on bind mounts, ensuring that agents can only access specific allowed directories (e.g., a designated workspace) and are blocked from sensitive system paths.
The vulnerability, identified as GHSA-M8V2-6WWH-R4GC, resides in the validateBindMounts function. It allows a malicious actor to bypass these restrictions by leveraging a flaw in how the system handles paths that do not currently exist on the disk. Specifically, the validation logic fails to canonicalize paths when the target file (the "leaf" node) is missing, even if the parent directories contain symlinks pointing to restricted locations. This results in a classic Time-of-Check Time-of-Use (TOCTOU) style logical bypass, granting the sandbox read/write access to the host filesystem.
The root cause lies in the tryRealpathAbsolute helper function within src/agents/sandbox/validate-sandbox-security.ts. This function is responsible for resolving a given path to its canonical absolute form (resolving all symlinks and .. segments) before security checks are applied against the allowedSourceRoots list.
The flaw stems from a performance optimization or logic oversight: the function checks if the full path exists using existsSync(path). If the path does not exist, the function immediately returns the raw, unvalidated input path without attempting to resolve the parent directory structure.
// VULNERABLE LOGIC
if (!existsSync(path)) return path; // Returns raw path if leaf is missingThis behavior assumes that a non-existent path is safe or cannot reference a restricted location. However, in a UNIX-like filesystem, a path like /safe/workspace/symlink_to_etc/new_file might not exist as a file, but its resolution depends on symlink_to_etc. By returning the raw path, the validator checks /safe/workspace/... (which passes the allowlist) instead of /etc/new_file (which would be blocked).
The following comparison illustrates the critical change in the patch. The fix ensures that even if the final file is missing, the validation logic traverses up the directory tree to find the nearest existing ancestor and resolves the path from there.
function tryRealpathAbsolute(path: string): string {
if (!path.startsWith("/")) return path;
// CRITICAL FLAW: Short-circuit prevents resolution of parent symlinks
if (!existsSync(path)) return path;
try {
return normalizeHostPath(realpathSync.native(path));
} catch {
return path;
}
}The fix introduces resolvePathViaExistingAncestor, which handles missing leaf nodes correctly:
function resolvePathViaExistingAncestor(sourcePath: string): string {
if (!sourcePath.startsWith("/")) return sourcePath;
const normalized = normalizeHostPath(sourcePath);
let current = normalized;
const missingSegments: string[] = [];
// Walk up until an existing directory is found
while (current !== "/" && !existsSync(current)) {
missingSegments.unshift(posix.basename(current));
current = posix.dirname(current);
}
// If we hit root and nothing exists, return original
if (!existsSync(current)) return normalized;
try {
// Resolve the deepest existing ancestor
const resolvedAncestor = normalizeHostPath(realpathSync.native(current));
// Reconstruct the full path with the resolved base + missing segments
if (missingSegments.length === 0) return resolvedAncestor;
return normalizeHostPath(posix.join(resolvedAncestor, ...missingSegments));
} catch {
return normalized;
}
}An attacker with control over the agent's workspace can exploit this vulnerability to write files to arbitrary locations on the host system (e.g., creating a cron job or modifying SSH keys).
/home/user/openclaw/workspace), the attacker creates a symlink pointing to a sensitive system directory.
ln -s /etc/cron.d /home/user/openclaw/workspace/exploit_link/home/user/openclaw/workspace/exploit_link/evil_job/mnt/agent/job/home/user/openclaw/workspace.tryRealpathAbsolute. Since evil_job does not exist yet, existsSync fails, and the function returns the raw path.allowedSourceRoots check./home/user/openclaw/workspace/exploit_link to /etc/cron.d. The bind mount connects /etc/cron.d/evil_job on the host to /mnt/agent/job in the container./mnt/agent/job, which appears on the host at /etc/cron.d/evil_job and is executed by the host system.The impact of this vulnerability is Critical for deployments where the host system is sensitive.
/etc/cron.d, /root/.ssh, or /etc/ld.so.conf.d, an attacker can escalate privileges from the sandboxed agent to full root access on the host machine.blocked-path configuration intended to protect sensitive paths like /proc, /sys, and /var.CVSS Vector (Estimated): CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H (High/Critical). The Scope change (S:C) is key here, as the vulnerability allows the attacker to break out of the sandbox (the constrained component) and affect the host (the user component).
Users must upgrade OpenClaw immediately to a version that includes the patch from February 24, 2026.
b5787e4abba0dcc6baf09051099f6773c1679ec1If an upgrade is not immediately possible:
auditd or similar tools to monitor for symlink creation within agent workspaces pointing to /, /etc, or /var.allowedSourceRoots are as specific as possible and do not reside on filesystems where untrusted users can create symlinks.CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | <= 2026.2.23 | Post-2026.2.23 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-59 (Link Following) |
| Attack Vector | Local (Sandbox Escape) |
| Impact | Host Filesystem Read/Write |
| CVSS Score | 8.2 (High) |
| Exploit Status | PoC Available |
| Affected Component | validateBindMounts |
Improper Link Resolution Before File Access ('Link Following')
CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.
A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.
A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.
An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.
GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.
CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.