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·13 visits

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

•12 minutes ago•CVE-2025-53837
9.9

CVE-2025-53837: Remote Code Execution in XWiki Rendering via Macro Escape Injection

CVE-2025-53837 is a critical remote code execution (RCE) vulnerability in XWiki Rendering before versions 14.10.2 and 15.0 RC1. The vulnerability arises from a failure to escape macro closing tags within raw output handled by HTML macro blocks. This allows low-privilege users to escape the restricted HTML container and execute high-privilege scripts under the application's context.

Alon Barad
Alon Barad
1 views•4 min read
•about 1 hour ago•CVE-2026-77281
6.5

CVE-2026-77281: Rewrite Placeholder Re-expansion Vulnerability in Caddy Web Server

A critical double-evaluation vulnerability exists in the rewrite module of the Caddy web server. Under specific configurations where a rewrite directive ends with a literal question mark and processes client-controlled headers, the system performs a secondary expansion pass. This allows attackers to evaluate arbitrary internal placeholder variables, leading to unauthorized disclosure of sensitive environment variables and system files.

Amit Schendel
Amit Schendel
4 views•8 min read
•about 2 hours ago•CVE-2026-77615
8.7

CVE-2026-77615: Stored Cross-Site Scripting (XSS) in Paella Player as used in Opencast

CVE-2026-77615 is a high-severity Stored Cross-Site Scripting (XSS) vulnerability in the Paella Player component, which is integrated as the default front-end media viewer in Opencast. Unsafe client-side rendering of subtitle tracks allows authenticated, low-privileged users to inject arbitrary JavaScript payloads via crafted WebVTT or DFXP files. The script executes within the context of any viewer session under the host origin, enabling session hijacking and unauthorized API interaction.

Alon Barad
Alon Barad
3 views•5 min read
•about 3 hours ago•GHSA-9395-2G46-RJ3F
8.2

GHSA-9395-2G46-RJ3F: Multiple Cross-Site Scripting (XSS) Vulnerabilities in djust Template and Live Engine

A comprehensive technical analysis of six Cross-Site Scripting (XSS) vulnerability classes in the djust framework versions 1.0.0 through 1.1.0, involving escaping failures across the Python-Rust template boundary and stateful WebSocket cache lifecycles.

Alon Barad
Alon Barad
4 views•10 min read
•about 4 hours ago•GHSA-XJW9-38CR-6372
8.2

GHSA-XJW9-38CR-6372: Cross-Site Scripting via Stale Safe-Key Inheritance in djust Template Shadowing

An escaping defect in the djust templating engine allows Cross-Site Scripting (XSS) when a template binding construct shadows a variable that was previously marked safe. The Rust-based context safety tracking incorrectly preserves name-based safety grants even after the variable name has been bound to a new, untrusted value.

Amit Schendel
Amit Schendel
5 views•6 min read
•about 5 hours ago•CVE-2026-81875
7.5

CVE-2026-81875: Unbounded DEFLATE Decompression Denial of Service in HAPI FHIR SHCParser

A critical denial of service vulnerability exists in the HAPI FHIR SHCParser within the org.hl7.fhir.core Java library. Unbounded decompression of raw DEFLATE data during Smart Health Card parsing allows unauthenticated remote attackers to trigger JVM heap exhaustion and crash the application.

Alon Barad
Alon Barad
6 views•7 min read