Mar 26, 2026·4 min read·37 visits
Inconsistent environment variable sanitization in OpenClaw's skill execution pipeline permits malicious overrides of variables like HOME and ZDOTDIR, enabling unauthenticated Remote Code Execution on the host.
OpenClaw versions prior to 2026.3.22 are vulnerable to Remote Code Execution (RCE) due to inconsistent sanitization of environment variable overrides between the Gateway and Node components. This architectural flaw allows attackers to inject shell-sensitive variables, resulting in arbitrary command execution on the host system.
OpenClaw is a personal AI assistant platform designed to automate tasks by executing commands on the host system. The platform employs "skills" that define specific workflows, which frequently require overriding standard environment variables during task execution.
A critical vulnerability, tracked as GHSA-39pp-xp36-q6mg, exists in the platform's environment variable sanitization routines. The flaw allows malicious inputs to bypass filtering mechanisms, enabling attackers to inject sensitive shell-control variables into the execution context.
When these manipulated environment variables are processed by the underlying shell, they alter the shell's configuration loading sequence. This architectural oversight leads directly to unauthenticated remote code execution on the system hosting the OpenClaw Node component.
The OpenClaw architecture utilizes a bifurcated execution model, dividing responsibilities between a Gateway and a Node. The Gateway processes incoming requests and API interactions, while the Node handles physical task execution on the host operating system. Each component independently implemented logic to sanitize environment variable keys supplied by skill configurations.
The vulnerability stems from an inconsistency between these two sanitization paths within the Skill Env Handler component, specifically inside the applySkillConfigEnvOverrides function. The Gateway component applied a permissive filter, allowing specific high-risk environment variables to pass through the initial validation boundary.
Upon receiving the payload, the Node component inherited the pre-processed keys without re-validating them against the global "Shared Host Environment Policy." This failure to enforce defense-in-depth permitted attackers to inject configuration-altering variables such as HOME, ZDOTDIR, or BASH_ENV directly into the execution environment.
Exploitation requires the attacker to supply a crafted skill configuration to the OpenClaw Gateway. The configuration must include environment variable overrides targeting specific shell initialization parameters. For example, setting ZDOTDIR=/tmp/payload_dir instructs the /bin/zsh executable to look for its .zshenv initialization file in the specified directory rather than the user's actual home directory.
Once the crafted environment variables bypass the Gateway and are accepted by the Node, the OpenClaw platform attempts to execute the requested skill task. The system spawns a new shell process, which immediately consumes the injected environment variables during its startup sequence.
The shell runtime processes the manipulated variables and executes the attacker-controlled configuration file. This sequence grants the attacker arbitrary code execution privileges matching the user context of the OpenClaw Node process, entirely bypassing intended application restrictions.
The remediation, implemented in Pull Request #51207 by developer joshavant, fundamentally restructures the environment variable handling logic. The patch deprecates the fragmented validation approach in favor of a unified, strict sanitization flow utilized concurrently by both the Gateway and the Node.
The patched applySkillConfigEnvOverrides function introduces explicit blocklists for shell-sensitive variables. Keys such as HOME, ZDOTDIR, PATH, and LD_PRELOAD are now categorically rejected regardless of where they enter the pipeline.
Additionally, the patch implements a fail-closed mechanism for task execution. If a blocked or malformed override key is detected during processing, the system explicitly aborts the task rather than silently dropping the invalid key. This design prevents partial execution states that might otherwise be leveraged for subsequent variant attacks.
The ability to execute arbitrary code on the host system represents a complete compromise of the OpenClaw Node. Because personal AI assistants require broad permissions to manage local development environments and system tasks, the OpenClaw process typically operates with elevated privileges or extensive filesystem access.
An attacker successfully exploiting this vulnerability gains persistent access to the host operating system. This access facilitates the exfiltration of sensitive personal data, source code, and persistent credentials stored within the local environment.
Furthermore, the compromised Node can serve as a pivot point for lateral movement within a broader network. The execution context granted by the vulnerability allows attackers to install persistent backdoors, deploy secondary payloads, or manipulate the AI assistant's ongoing operations without detection.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
OpenClaw OpenClaw | < 2026.3.22 | 2026.3.22 |
| Attribute | Detail |
|---|---|
| Vulnerability Class | Environment Variable Injection |
| CWE ID | CWE-78 |
| Attack Vector | Network |
| Impact | Remote Code Execution |
| Exploit Status | Unexploited / Undisclosed |
| Component | Skill Env Handler |
Improper Neutralization of Special Elements used in an OS Command
CVE-2026-85724 is a critical vulnerability in the Moquette MQTT broker (versions prior to 0.18.1) where unvalidated substitution of client identifiers and usernames into pattern-based Access Control Lists (ACLs) permits remote authenticated attackers to bypass multi-tenant boundaries and trigger a Denial of Service.
CVE-2026-88974 is an incorrect authorization vulnerability in the WPGraphQL plugin for WordPress. Due to a failure to perform object-level capability checks or validate status-transition requirements in the updatePost mutation handler, authenticated Contributor-level users can publish their own draft posts without editorial approval or modify their previously published posts.
A technical analysis of CVE-2026-73858 / GHSA-gxrg-x694-283w, a server-side template injection vulnerability in the Solspace Freeform plugin for Craft CMS. The vulnerability permits unauthenticated users to trigger dynamic Twig evaluation of input fields during form validation re-rendering, causing local directory path disclosure and PHP runtime information exposure.
An algorithmic complexity vulnerability (CWE-407) in the query decoder of the Elixir Plug library (CVE-2026-54892) allows unauthenticated remote attackers to trigger scheduler starvation and denial of service by transmitting deeply nested brackets in query parameters or URL-encoded post bodies.
CVE-2026-83801 is a stored Cross-Site Scripting (XSS) vulnerability in Nautobot. The vulnerability arises because the application interpolates user-controlled database properties—specifically Relationship descriptions and Module Family names—directly into the help_text parameter of Django form fields. These fields are rendered using Django's |safe filter, bypassing HTML escaping and enabling persistent injection. When an administrative user accesses the affected forms, the payload executes contextually in their browser. This allows attackers to hijack active sessions and perform unauthorized operations. Nautobot versions prior to v2.4.37 and v3.1.8 are affected by this vulnerability. The issue has been patched by implementing contextual HTML escaping and strict markdown sanitization.
An authorization bypass vulnerability exists in Nautobot's REST API endpoints handling approval workflows. Due to an architectural inconsistency, a standalone, generic REST API endpoint for creating approval responses was exposed without propagating the required business-logic validations. This allows low-privileged authenticated users to submit forged, self-approved votes, bypassing approval thresholds and triggering unauthorized server-side automated jobs.