CVE-2026-31990 Overview
CVE-2026-31990 is a symlink attack vulnerability affecting OpenClaw versions prior to 2026.3.2. The vulnerability exists in the stageSandboxMedia function, which fails to properly validate destination symlinks during media staging operations. This allows write operations to follow symlinks outside the sandbox workspace, enabling attackers to overwrite arbitrary files on the host system beyond sandbox boundaries.
Critical Impact
Attackers with local access can exploit this vulnerability by placing malicious symlinks in the media/inbound directory to escape sandbox restrictions and overwrite arbitrary files on the host system, potentially leading to privilege escalation or system compromise.
Affected Products
- OpenClaw versions prior to 2026.3.2
- OpenClaw for Node.js (all vulnerable versions)
Discovery Timeline
- 2026-03-19 - CVE-2026-31990 published to NVD
- 2026-03-19 - Last updated in NVD database
Technical Details for CVE-2026-31990
Vulnerability Analysis
This vulnerability falls into the category of File System vulnerabilities, specifically a Symlink Attack (CWE-59: Improper Link Resolution Before File Access). The stageSandboxMedia function in OpenClaw is designed to handle media files within a sandboxed workspace environment. However, the function fails to verify whether destination paths contain symbolic links that point outside the intended sandbox directory.
When media files are staged through the vulnerable function, write operations blindly follow any symlinks present in the destination path. This allows an attacker who can create files in the media/inbound directory to plant symbolic links that point to sensitive system files or directories. Subsequent staging operations will then overwrite these external targets, effectively bypassing the sandbox containment mechanism.
The vulnerability requires local access and low privileges to exploit, as the attacker must be able to create symlinks within the media inbound directory. While this limits the attack surface compared to remotely exploitable vulnerabilities, the impact remains significant because successful exploitation allows writes to arbitrary locations on the filesystem outside the sandbox.
Root Cause
The root cause of CVE-2026-31990 is improper link resolution before file access in the stageSandboxMedia function. The original implementation did not validate whether destination paths contained symbolic links or whether those links pointed to locations within the authorized sandbox workspace. This lack of validation violates the principle of sandbox containment, where all file operations should be strictly confined to designated directories.
Attack Vector
The attack requires local access and follows this general pattern:
- Attacker identifies the media/inbound directory used by OpenClaw's sandbox
- Attacker creates a symbolic link within this directory pointing to a target file outside the sandbox (e.g., system configuration files)
- When legitimate media staging operations occur, the stageSandboxMedia function follows the symlink
- File content is written to the attacker-specified target location outside the sandbox
- Depending on the target file, this can lead to privilege escalation, denial of service, or further system compromise
The security patch addresses this by introducing safe file handling utilities:
import { ensureSandboxWorkspaceForSession } from "../../agents/sandbox.js";
import type { OpenClawConfig } from "../../config/config.js";
import { logVerbose } from "../../globals.js";
+import { readLocalFileSafely, writeFileWithinRoot } from "../../infra/fs-safe.js";
import { normalizeScpRemoteHost } from "../../infra/scp-host.js";
+import { resolvePreferredOpenClawTmpDir } from "../../infra/tmp-openclaw-dir.js";
import {
isInboundPathAllowed,
resolveIMessageRemoteAttachmentRoots,
Source: GitHub Commit Changes
The patch introduces readLocalFileSafely and writeFileWithinRoot functions from a new fs-safe.js module, which perform proper path validation to ensure all file operations remain within authorized directories.
Detection Methods for CVE-2026-31990
Indicators of Compromise
- Presence of unexpected symbolic links in the media/inbound directory pointing to locations outside the sandbox workspace
- Unexpected modification timestamps on system files that should not be written by OpenClaw
- Audit logs showing file write operations to paths outside the expected sandbox directory tree
- Presence of files owned by the OpenClaw process user in unexpected system locations
Detection Strategies
- Implement file integrity monitoring (FIM) on critical system files to detect unauthorized modifications
- Monitor the media/inbound directory for creation of symbolic links, especially those pointing outside the sandbox
- Review OpenClaw process activity for file operations targeting paths outside designated workspace directories
- Deploy endpoint detection and response (EDR) solutions that can identify symlink-based sandbox escape attempts
Monitoring Recommendations
- Enable detailed audit logging for file system operations performed by the OpenClaw service account
- Configure alerts for symlink creation events within OpenClaw's media directories
- Implement real-time monitoring of sandbox boundary integrity using security tools
- Establish baseline behavior for OpenClaw file operations and alert on deviations
How to Mitigate CVE-2026-31990
Immediate Actions Required
- Upgrade OpenClaw to version 2026.3.2 or later immediately
- Audit existing media/inbound directories for suspicious symbolic links and remove any unauthorized entries
- Review file system permissions to ensure the OpenClaw service account has minimal necessary privileges
- Implement additional file system restrictions using operating system security features (e.g., mount options, SELinux policies)
Patch Information
The vulnerability has been addressed in OpenClaw version 2026.3.2. The fix introduces hardened file handling utilities that validate destination paths before performing write operations. Security patches are available through the official GitHub repository.
For detailed information about the security fix, refer to the GitHub Security Advisory and the commit implementing the fix.
Workarounds
- Restrict write permissions on the media/inbound directory to prevent unauthorized symlink creation
- Implement operating system-level restrictions to prevent the OpenClaw process from following symlinks outside designated directories
- Use container isolation or virtualization to provide additional boundaries around the OpenClaw sandbox
- Deploy file access control mechanisms that prevent writes to sensitive system paths from the OpenClaw service context
# Configuration example - Restrict symlink following in media directories
# Add nofollow mount option for the OpenClaw workspace (Linux)
mount -o remount,nosymfollow /path/to/openclaw/workspace
# Alternatively, use chattr to make the inbound directory append-only
chattr +a /path/to/openclaw/media/inbound
# Review and remove any existing symlinks in the inbound directory
find /path/to/openclaw/media/inbound -type l -delete
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


