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



CVE-2026-53858

CVE-2026-53858: Local Code Execution via Untrusted Search Path in OpenClaw

Alon Barad
Alon Barad
Software Engineer

Jun 19, 2026·7 min read·1 visit

Executive Summary (TL;DR)

OpenClaw prior to 2026.5.2 loads critical system state paths from untrusted workspace `.env` files, enabling local code execution through dependency path hijacking.

OpenClaw versions prior to 2026.5.2 are vulnerable to an untrusted search path flaw (CWE-426) during workspace initialization. When an operator opens a workspace, the application parses the workspace's local `.env` file and uses the unvalidated `STATE_DIRECTORY` variable to resolve and execute bundled runtime dependencies. An attacker can exploit this to achieve local code execution under the security context of the operator.

Vulnerability Overview

OpenClaw is an application platform utilizing a trusted-operator design pattern. This architecture assumes that operators with execution boundaries and plugin management privileges are trusted security actors. However, when operators clone and open external repositories, the attack surface expands to include local configuration files present within the workspace directory.

The vulnerability identified as CVE-2026-53858 is an instance of an untrusted search path vulnerability, classified as CWE-426. The vulnerability occurs during the early parsing phase when OpenClaw opens a new repository or workspace. During this phase, the application processes environment variables defined in local configuration files without proper verification.

By manipulating the STATE_DIRECTORY variable within a repository-specific configuration file, an attacker can override system-defined runtime pathways. This redirection forces the application to load bundled dependencies from the specified local directory rather than the secure, system-defined system state directory. The resulting outcome is arbitrary code execution under the security privileges of the active operator.

Root Cause Analysis

The root cause of the flaw lies in the premature evaluation of workspace-level configuration variables before establishing secure runtime boundaries. When an operator loads a workspace, OpenClaw immediately reads and parses the repository's .env file to set up the development context. This parsing routine does not distinguish between user-defined application variables and critical system environment variables.

Specifically, the STATE_DIRECTORY environment variable dictates the directory structure where OpenClaw expects its core execution states and bundled runtime dependencies. When the application engine initializes its dependency resolver, it queries this parsed environment variable to locate its modules. Because the configuration loading process is not isolated, the workspace-level .env file successfully overrides this critical system-level path.

The application subsequently utilizes this unvalidated path to resolve and dynamically import Javascript modules. In Node.js environments, standard module resolution or file system search patterns will traverse the specified folder to find the target modules. This behavior completes the untrusted search path condition, as the application searches an arbitrary directory provided by an external, untrusted source.

Code Analysis

The vulnerable path relies on an insecure configuration loader that merges workspace-level .env properties directly into the global process environment. In the vulnerable version, the environment parser reads the local file and applies all key-value pairs directly to process.env without filtering. Below is a representation of the vulnerable configuration sequence:

// Vulnerable configuration sequence in OpenClaw (< 2026.5.2)
const dotenv = require('dotenv');
const path = require('path');
 
function initializeWorkspace(workspacePath) {
    // Vulnerability: Reads local workspace .env and merges it into process.env
    dotenv.config({ path: path.join(workspacePath, '.env') });
    
    // Resolves the state path directly from process.env with no validation
    const stateDir = process.env.STATE_DIRECTORY || '/var/lib/openclaw';
    
    // Loads dynamic libraries from the unvalidated state directory
    const dependencyRoot = path.resolve(stateDir, 'deps');
    const coreRuntime = require(path.join(dependencyRoot, 'runtime.js'));
    coreRuntime.init();
}

In the patched version (2026.5.2), the application introduces an environment variable blocklist and enforces strict isolation of system configuration parameters. Workspace configuration files are parsed into a separate, isolated object, and critical keys such as STATE_DIRECTORY are stripped before any environment merging occurs.

// Patched configuration sequence in OpenClaw (2026.5.2)
const dotenv = require('dotenv');
const path = require('path');
const fs = require('fs');
 
const SYSTEM_BLOCKED_VARS = ['STATE_DIRECTORY', 'NODE_OPTIONS', 'PATH'];
 
function initializeWorkspaceSecure(workspacePath) {
    const envPath = path.join(workspacePath, '.env');
    if (fs.existsSync(envPath)) {
        const parsedEnv = dotenv.parse(fs.readFileSync(envPath));
        
        // Mitigation: Filter out system-critical environment variables
        for (const key of Object.keys(parsedEnv)) {
            if (!SYSTEM_BLOCKED_VARS.includes(key)) {
                process.env[key] = parsedEnv[key];
            } 
        }
    }
    
    // Resolves the state path strictly from secure system environment or defaults
    const stateDir = process.env.STATE_DIRECTORY || '/var/lib/openclaw';
    const dependencyRoot = path.resolve(stateDir, 'deps');
    
    // Ensures load path resolves within a trusted system directory
    const coreRuntime = require(path.join(dependencyRoot, 'runtime.js'));
    coreRuntime.init();
}

The patch successfully prevents workspace-level files from manipulating the runtime path. However, security teams must note that other environment-dependent loaders within the application could still be susceptible to similar overrides if third-party configuration libraries are introduced. Complete remediation requires continuous auditing of all path-building operations that rely on external variables.

Exploitation Methodology

Exploiting this vulnerability requires an operator to actively open an untrusted repository containing a crafted directory structure and a malicious .env file. The attack payload consists of two primary components: a configuration file setting the STATE_DIRECTORY variable, and a nested directory structure mirroring the expected dependency structure. Below is a structural representation of the exploit delivery:

The attacker defines the STATE_DIRECTORY variable to point to a relative path within the repository, such as ./attacker_libs. Inside this folder, the attacker places a file at deps/runtime.js containing arbitrary JavaScript code. When the victim clones and opens the workspace within OpenClaw, the configuration parser reads the .env file, updates the process environment, and immediately triggers the loading mechanism.

Because the application attempts to resolve runtime.js via the manipulated path, it loads the attacker's script from ./attacker_libs/deps/runtime.js. The payload executes under the same user privileges and system access rights as the active OpenClaw operator process. This bypasses typical access control lists and permits unauthenticated local code execution on the operator's machine.

Impact Assessment

The impact of successful exploitation is complete system compromise within the execution context of the OpenClaw operator. Since many operators run these environments with high privileges or within development networks, the execution of arbitrary commands provides a beachhead for lateral movement. The attacker can extract environment secrets, steal access tokens, or modify source code files.

The vulnerability is evaluated with a CVSS v4.0 base score of 7.0 and a CVSS v3.1 score of 7.1. The severity is marked as High because it requires minimal complexity and no special administrative permissions to execute. However, user interaction is a strict prerequisite, as the operator must consciously open the malicious directory.

While there are currently no known public exploits or evidence of active exploitation in the wild, the ease of crafting a payload makes this a highly viable vector for targeted supply-chain attacks. The EPSS score remains low at 0.00124, reflecting the lack of public tooling, but organizations should prioritize remediation to secure internal development environments.

Remediation & Mitigation

The primary and recommended mitigation is upgrading the OpenClaw installation to version 2026.5.2 or later. This release enforces strict validation on environment variables loaded from workspace directories, preventing the overriding of sensitive system-level paths. Systems should be configured to automatically apply patches for core development and runtime utilities.

If immediate patching is not feasible, operators must implement defensive workarounds. One critical workaround is to disable the automatic loading of workspace-level environment configurations in the system preferences. Operators should also manually inspect any .env files in external repositories for variables like STATE_DIRECTORY before opening them.

Additionally, security teams can implement file integrity monitoring and static analysis rules to flag hazardous configurations. Network isolation policies should also be applied to operator workspaces to restrict outbound connections from development platforms, mitigating the impact of code execution by preventing the exfiltration of credentials or the establishment of reverse shells.

Official Patches

OpenClawOpenClaw Official Repository

Technical Appendix

CVSS Score
7.1/ 10
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N
EPSS Probability
0.12%
Top 98% most exploited

Affected Systems

OpenClaw (npm package 'openclaw') running on developer or operator workspaces

Affected Versions Detail

Product
Affected Versions
Fixed Version
openclaw
OpenClaw
< 2026.5.22026.5.2
AttributeDetail
CWE IDCWE-426 (Untrusted Search Path)
Attack VectorLocal (L)
CVSS v3.1 Score7.1 (High)
EPSS Score0.00124 (Percentile: 2.46%)
ImpactLocal Code Execution (LCE)
Exploit StatusNone (No public exploit/PoC available)
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1574.009Hijack Execution Flow: Path Interception
Persistence, Privilege Escalation, Defense Evasion
T1574Hijack Execution Flow
Persistence, Privilege Escalation, Defense Evasion
CWE-426
Untrusted Search Path

The application uses an external path or environment variable to search for critical resources without adequately validating the path's integrity.

Vulnerability Timeline

CVE published by VulnCheck
2026-06-16
OSV records GitHub Advisory and updates mapping
2026-06-18

References & Sources

  • [1]GitHub Security Advisory GHSA-wc84-j36w-pw4x
  • [2]VulnCheck Security Advisory
  • [3]CVE.org Official Record
  • [4]NVD Official Record

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.

More Reports

•16 minutes ago•CVE-2026-53850
5.5

CVE-2026-53850: Missing Authorization in OpenClaw focus Command Control Scope Enforcement

An authorization bypass vulnerability in OpenClaw versions prior to 2026.4.25 allows authenticated users to execute the 'focus' command without proper controlScope validation. Because the routing engine fails to enforce configured access policies on this specific command pathway, low-privilege operators can alter the gateway's global focus state, leading to potential unauthorized cross-channel or cross-session interaction depending on downstream configuration.

Alon Barad
Alon Barad
0 views•5 min read
•about 1 hour ago•CVE-2026-53849
8.6

CVE-2026-53849: Privilege Escalation and Authentication Bypass via Mutable Discord Display Names in OpenClaw allowFrom

OpenClaw before version 2026.5.7 contains a security vulnerability where the allowFrom feature improperly validates Discord account identity using mutable display names rather than immutable user IDs. This allows remote attackers to bypass authorization controls and escalate privileges by changing their Discord display or global names to match a configured policy entry.

Alon Barad
Alon Barad
1 views•6 min read
•about 2 hours ago•CVE-2026-53865
7.2

CVE-2026-53865: Arbitrary Local Command Execution in OpenClaw via Untrusted Search Path

A critical untrusted search path vulnerability (CWE-426) exists in OpenClaw, an open-source, multi-platform personal AI assistant. In versions prior to 2026.5.2 (and up to 2026.5.26 in specific deployment configurations), the application merges workspace-derived configuration parameters into the operating system environment object. When executing administrative maintenance routines, OpenClaw invokes external system commands, such as the 'trash' utility, without verifying the underlying executable path. This allows a low-privileged local user or workspace collaborator to hijack binary execution flows, resulting in arbitrary command execution within the privilege context of the OpenClaw service wrapper.

Amit Schendel
Amit Schendel
1 views•6 min read
•about 3 hours ago•CVE-2026-53852
5.4

CVE-2026-53852: Scope Containment Bypass in OpenClaw Device Re-pairing

OpenClaw versions prior to 2026.4.25 are subject to a scope containment bypass vulnerability in the device re-pairing component. When processing re-pairing requests, the application backend fails securely, allowing authenticated operators to bypass authorization containment policies. By submitting a re-pairing payload with an empty or omitted scope array, an operator can skip containment checks and retain broader, previously established administrative privileges. This vulnerability is classified under CWE-636: Not Failing Securely ('Failing Open').

Amit Schendel
Amit Schendel
2 views•8 min read
•about 3 hours ago•CVE-2026-53854
6.0

CVE-2026-53854: Privilege Escalation via Wildcard Authorization Inheritance in OpenClaw

CVE-2026-53854 is an authorization bypass vulnerability in OpenClaw, an open-source WhatsApp gateway CLI and Pi RPC agent. The flaw exists in the command authentication flow where low-privilege actors communicating via internal or webchat interfaces inherit global wildcard authorization states across channel boundaries. This cross-channel inheritance allows unauthorized command execution with administrative privileges.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 4 hours ago•CVE-2026-0755
9.8

CVE-2026-0755: Remote Code Execution and Arbitrary File Exfiltration in gemini-mcp-tool

CVE-2026-0755 is a critical vulnerability in gemini-mcp-tool (<= 1.1.5) that allows unauthenticated remote code execution on Windows installations and arbitrary local file exfiltration across all supported operating systems. The flaws exist within the execAsync command runner and the input handling logic of the Model Context Protocol (MCP) server, which fails to securely escape arguments passed to Node.js child processes and does not validate local file references in user-supplied prompt strings.

Alon Barad
Alon Barad
4 views•7 min read