CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-CFP9-W5V9-3Q4H
6.90.03%

GHSA-CFP9-W5V9-3Q4H: Filesystem Sandbox Bypass in OpenClaw Agent Media Tools

Alon Barad
Alon Barad
Software Engineer

Mar 27, 2026·7 min read·1 visit

PoC Available

Executive Summary (TL;DR)

OpenClaw < 2026.3.2 fails to enforce the workspaceOnly policy in its media tools. Attackers can leverage sandbox bridge mounts to read out-of-workspace files and exfiltrate data via vision model processing.

The OpenClaw AI agent framework contains a filesystem sandbox bypass vulnerability in its image and pdf tools. Due to improper path resolution and initialization of allowed directories, an attacker can extract sensitive files from the host system via the agent's vision model capabilities, bypassing the tools.fs.workspaceOnly security policy.

Vulnerability Overview

The OpenClaw AI agent framework provides a sandboxed execution environment designed to restrict agent filesystem access to a designated project workspace. This security boundary is enforced using the tools.fs.workspaceOnly configuration directive. When enabled, all file operations initiated by the agent should be strictly confined to the defined workspace directory, preventing the agent from reading or modifying arbitrary files on the host system.

The vulnerability resides in the implementation of the image and pdf tools within the OpenClaw framework. Unlike standard file input/output tools that correctly enforce the workspace boundary, these media tools contain logical flaws in their path resolution and initialization routines. Specifically, they fail to restrict their allowed operational directories, retaining access to default local roots even when the workspaceOnly policy is explicitly enabled.

This implementation flaw results in a CWE-863 (Incorrect Authorization) condition, ultimately leading to CWE-200 (Information Exposure). An attacker interacting with the agent can exploit this oversight to read sensitive files located outside the intended workspace. By passing crafted paths that resolve through sandbox bridge mounts, the attacker can force the agent to process host-level files and exfiltrate their contents via external vision model APIs.

Root Cause Analysis

The root cause of this vulnerability involves two distinct but related logical failures within the OpenClaw filesystem handling. The first failure occurs during the initialization of the allowed directory arrays for the media tools. In the vulnerable versions, the src/agents/tools/image-tool.ts and src/agents/tools/pdf-tool.ts modules populate a localRoots array to determine which directories the tools are permitted to access. These tools unconditionally invoked the getDefaultLocalRoots() function, which appends system-level and agent-internal directories (such as ~/.openclaw/media and ~/.openclaw/agents) to the allowlist.

This unconditional initialization means that the workspaceOnly policy check was effectively neutered for these specific tools. Even when the configuration explicitly mandated workspace restriction, the default host roots remained in the localRoots array. Consequently, any file path residing within these default directories would pass the tool's internal authorization checks, regardless of the overarching sandbox constraints.

The second failure occurs within the SandboxFsBridge component during path resolution. When the agent operates in sandboxed mode, paths provided to the tools (e.g., /agent/secret.png) are resolved by the bridge to determine their corresponding physical locations on the host system. The bridge's resolution logic returned the mapped host-side path without verifying if the resulting path adhered to the workspaceOnly constraint. The media tools then accepted this resolved host path directly, lacking a final assertSandboxPath validation step to ensure the physical path remained within the workspace boundary.

Code Analysis

The vulnerability was addressed across two targeted commits that rectified the initialization and resolution flaws. The first commit (dd9d9c1c609dcb4579f9e57bd7b5c879d0146b53) focused on enforcing the workspace boundary during the sandbox path resolution phase. The patch introduced an explicit call to assertSandboxPath within the resolveSandboxedImagePath function.

// Patched logic in resolveSandboxedImagePath
const resolved = bridge.resolve(inputPath);
if (params.sandbox.workspaceOnly) {
  assertSandboxPath({ filePath: resolved.hostPath, root: params.sandbox.root });
}
return resolved;

This addition guarantees that whenever the workspaceOnly flag is active, the host-side path returned by the bridge must physically reside within the defined sandbox.root. If the path escapes this root, the assertion throws an error, halting the operation.

The second commit (14baadda2c456f3cf749f1f97e8678746a34a7f4) addressed the flawed localRoots initialization in the tool creation factories (createImageTool and createPdfTool). The patch refactored the array generation to evaluate the workspaceOnly policy before appending any default system roots.

// Patched localRoots generation in createImageTool
const localRoots = (() => {
  const workspaceDir = normalizeWorkspaceDir(options?.workspaceDir);
  if (options?.fsPolicy?.workspaceOnly) {
    return workspaceDir ? [workspaceDir] : [];
  }
  const roots = getDefaultLocalRoots();
  if (workspaceDir) roots.push(workspaceDir);
  return roots;
})();

By returning early when workspaceOnly is true, the patched code completely isolates the tool to the workspaceDir. This structural change eliminates the possibility of the tool inadvertently authorizing access to ~/.openclaw/agents or other system paths when the sandbox is enforced.

Exploitation Methodology

Exploitation of this vulnerability relies on an attacker's ability to supply input to the OpenClaw agent and the presence of sandbox bridge mounts that map host directories into the sandboxed environment. The attacker does not require direct execution capabilities; instead, the attack is executed via prompt injection or direct parameter manipulation against an agent configured with the vulnerable image or pdf tools.

The attacker begins by identifying or deducing a sensitive file path that is mounted via the sandbox bridge but resides outside the intended workspace directory. Examples include configuration files mounted at /agent/config.json or SSH keys inadvertently bridged for deployment purposes. The attacker then constructs a natural language prompt instructing the agent to analyze the target file using one of the vulnerable media tools.

An example attack payload takes the form of: 'Analyze the image located at /agent/config.json and describe its content in detail.' Upon processing this prompt, the agent routes the request to the image tool. The tool resolves the bridged path to its host equivalent (e.g., ~/.openclaw/agents/config.json). Due to the localRoots initialization flaw, the path passes the authorization check. The tool reads the raw bytes of the target file and transmits them to the configured vision model API (such as Claude or GPT-4o).

The external AI model processes the file contents, assuming it to be a valid document or image. If the file contains text, the model will typically extract and describe it as part of its visual analysis. The agent then relays this generated description back to the attacker, effectively completing the data exfiltration loop and exposing the sensitive host-side data.

Impact Assessment

The primary security impact of this vulnerability is the unauthorized disclosure of sensitive information (CWE-200). By circumventing the filesystem sandbox, an attacker gains read access to files residing on the host system that are mapped into the container environment. The severity of the impact is directly correlated with the nature of the files accessible via the sandbox bridge mounts.

If the bridge mounts encompass directories containing credentials, API keys, or agent configuration files, the attacker can extract this material. This aligns with MITRE ATT&CK techniques T1005 (Data from Local System) and T1552 (Unsecured Credentials). The exfiltration vector leverages the agent's legitimate communication channels with external AI model providers, which may bypass traditional network egress filtering controls.

The vulnerability carries a CVSS 4.0 score of 6.9 (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N), reflecting its network-based attack vector and the impact on confidentiality. The Exploit Prediction Scoring System (EPSS) score is currently 0.00034 (0.09996 percentile), indicating a low baseline probability of mass exploitation. However, in multi-tenant environments or platforms offering OpenClaw agents as a service, the localized risk is significantly higher.

Remediation and Mitigation

The definitive remediation for this vulnerability is upgrading the openclaw npm package to version 2026.3.2 or later. This version incorporates the necessary path assertions in the sandbox bridge and correctly initializes the localRoots array to honor the workspaceOnly policy. Developers and system administrators must prioritize patching environments where OpenClaw agents process untrusted user input.

As an immediate mitigation strategy for deployments unable to upgrade, administrators must review and minimize the sandbox bridge configuration. Ensure that only strictly necessary directories are mounted into the sandbox environment. Removing mounts that expose sensitive system directories (e.g., user home directories, /etc, or SSH configuration paths) will effectively eliminate the accessible attack surface, even if the tools remain vulnerable to path traversal within the allowed mounts.

Security operations teams should implement detection mechanisms by monitoring OpenClaw agent logs. The patched version introduces explicit logging for path boundary violations. Alerting on log events containing the strings 'Path escapes sandbox root' or 'not under an allowed directory' provides high-fidelity detection of exploitation attempts. Regular auditing of the tools.fs.workspaceOnly: true configuration state is also necessary to prevent configuration drift.

Official Patches

OpenClaw GitHubSandbox Path Enforcement Patch
OpenClaw GitHubTool Roots Initialization Patch

Fix Analysis (2)

Technical Appendix

CVSS Score
6.9/ 10
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:L/SI:N/SA:N
EPSS Probability
0.03%
Top 100% most exploited

Affected Systems

OpenClaw AI Agent Framework (npm: openclaw)

Affected Versions Detail

Product
Affected Versions
Fixed Version
openclaw
OpenClaw
< 2026.3.22026.3.2
AttributeDetail
CWE IDCWE-863, CWE-200
Attack VectorNetwork / Remote
CVSS 4.06.9 (Medium)
EPSS Score0.00034
ImpactUnauthorized file read and data exfiltration
Exploit StatusProof of Concept (PoC)

MITRE ATT&CK Mapping

T1005Data from Local System
Collection
T1552Unsecured Credentials
Credential Access
CWE-863
Incorrect Authorization

Incorrect Authorization leading to Information Exposure

Known Exploits & Detection

Research ReportPrompt injection payload targeting the image tool to read out-of-workspace files.

Vulnerability Timeline

Initial fix commit dd9d9c1 for sandboxed image tool enforcement
2026-02-24
Follow-up fix commit 14baadd for image and pdf tool localRoots restriction
2026-03-02
CVE-2026-32002 published in NVD
2026-03-19
GitHub Advisory GHSA-CFP9-W5V9-3Q4H published
2026-03-26

References & Sources

  • [1]GitHub Advisory GHSA-CFP9-W5V9-3Q4H
  • [2]OSV Record GHSA-CFP9-W5V9-3Q4H
  • [3]GitLab Advisory CVE-2026-32002
Related Vulnerabilities
CVE-2026-32002

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.