/

CVE-2026-41383

Severity:

HIGH RISK

(8.1)

Path Traversal / Arbitrary File System Access

CVE-2026-41383

Analyzed

Vulnerability type

Category:

Path Traversal / Arbitrary File System Access

CWE:

CWE-22

Impact:

Arbitrary Remote Directory Deletion and Data Overwrite

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw mirror mode before version 2026.4.2 contains a path traversal-style configuration flaw that can lead to arbitrary remote directory deletion.

By manipulating the remoteWorkspaceDir and remoteAgentWorkspaceDir configuration values, an attacker can cause mirror sync operations to delete unintended directories and replace their contents with attacker-controlled workspace data.

Affected context

This vulnerability appears in OpenClaw deployments that use mirror mode with configurable remote workspace paths.

The issue becomes relevant when:

  • The OpenShell configuration allows user-provided or loosely validated values for remoteWorkspaceDir and remoteAgentWorkspaceDir
  • The mirror sync feature is enabled to keep local and remote workspaces aligned
  • The system trusts these configured paths without enforcing strict boundaries (e.g., a fixed root directory)

Under these conditions, crafted configuration values can redirect delete and sync operations to unintended locations on the remote system.

Exploit preconditions

  • Attack surface: OpenClaw/OpenShell configuration for mirror mode and associated remote workspace paths.
  • Required access: Ability to modify or influence remoteWorkspaceDir and/or remoteAgentWorkspaceDir (e.g., via configuration files, UI settings, environment variables, or API-controlled config).
  • Trigger point: Execution of a mirror synchronization operation that:
  • Deletes remote contents assumed to be part of the workspace, and
  • Replaces them with the local or uploaded workspace data.
  • Why exploitation is possible: The product does not sufficiently constrain or normalize the remote workspace paths before using them in deletion and synchronization routines, allowing attacker-controlled paths to point to directories outside the intended workspace boundary.

Why this happens

The core issue maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

OpenClaw trusts the configured remoteWorkspaceDir and remoteAgentWorkspaceDir as safe root locations for mirror operations without:

  • Enforcing that these paths remain under a specific allowed directory tree, or
  • Applying robust normalization and validation to remove traversal sequences or unsafe values.

As a result, delete-and-sync logic operates on attacker-directed paths and can recursively remove directory contents in arbitrary remote locations, effectively turning a workspace sync into a powerful deletion and overwrite primitive.

Potential impact

  • Deletion of arbitrary directories on the remote host that are accessible to the OpenClaw agent.
  • Overwrite of remote directories with attacker-controlled workspace data, leading to data corruption.
  • Disruption of services whose configuration, logs, or data directories are targeted.
  • Loss of integrity for build artifacts, deployment assets, or shared project files stored on the remote system.
  • Potential stepping stone to broader operational impact if critical system paths or application data are affected.

General mitigation guidance

Hardening typically focuses on constraining and validating file system paths used by synchronization features and reducing the blast radius of any misconfiguration.

Common defensive patterns include:

  • Restrict workspace roots: Enforce that remoteWorkspaceDir and remoteAgentWorkspaceDir must reside within a predefined, application-controlled root directory, rejecting any configuration outside that boundary.
  • Normalize and validate paths: Apply canonicalization, removal of traversal sequences (e.g., ".."), and checks against symbolic links before performing delete or sync operations.
  • Use allowlists instead of raw config: Offer predefined or server-side managed workspace roots rather than arbitrary user-specified paths.
  • Limit deletion scope: Design sync routines to operate on known subdirectories and avoid broad recursive deletion on configurable paths.
  • Least privilege for the agent: Run remote agents with the minimum file system privileges required, avoiding permissions on sensitive system or shared directories.
  • Protect configuration channels: Treat configuration inputs as sensitive, applying authentication, authorization, and change auditing to prevent unauthorized modifications.

How teams detect issues like this

Detection efforts can focus both on code-level patterns and runtime behavior:

  • Static analysis and code review:
  • Flag code that uses configuration-derived paths in delete, move, or recursive sync operations without path normalization and boundary checks.
  • Look for direct concatenation of configuration values into file system operations (e.g., rm, recursive delete, or library equivalents).
  • Verify that all workspace-related paths are validated against an enforced root directory.
  • Configuration policy checks:
  • Implement policies that disallow unsafe path patterns (e.g., "..", absolute paths outside allowed roots) in workspace configuration fields.
  • Apply automated checks on configuration changes to detect suspicious or out-of-bound paths before they are deployed.
  • Runtime and operational monitoring:
  • Log mirror operations with the resolved target paths and detect deletions targeting unexpected directories.
  • Use host-based monitoring to alert on large-scale deletions initiated by the OpenClaw agent outside expected workspace trees.
  • Automated tooling:
  • Integrate security linters or SAST tools configured to detect unvalidated path usage in sync and cleanup routines.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/b21c9840c2e38f4bb338d031511b479d5f07ca25
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-m34q-h93w-vg5x
vulncheck.comvulncheck.com/advisories/openclaw-arbitrary-remote-directory-deletion-via-mis-scoped-mirror-mode-paths

Frequently asked

questions

Exploitability depends on who can change the OpenClaw/OpenShell configuration. If untrusted users or integrated systems can set remoteWorkspaceDir or remoteAgentWorkspaceDir, they can potentially redirect mirror operations to delete and overwrite arbitrary remote directories accessible to the agent.

The attacker must have the ability to influence configuration values controlling remote workspace paths. This might occur through a management UI, API, configuration files, or CI/CD integration, depending on how OpenClaw is deployed and who has access to those channels.

The most robust fix is to enforce strict path constraints: define a fixed, server-side controlled root directory for remote workspaces, normalize any configured paths, and reject values that attempt to escape or reference external locations. Additionally, limit deletion operations to known, internal subpaths.

Future designs should treat any path coming from configuration or user input as untrusted. Apply canonicalization, enforce directory boundaries, avoid performing broad deletion or recursive operations on configurable paths, and ensure agents operate with least privilege so that even misconfigured paths cannot reach sensitive areas of the file system.

Find out what's already
exploitable in your codebase.