OpenClaw Remote Code Execution Vulnerability via Environment Variable Injection

Vulnerability

A remote code execution vulnerability exists in OpenClaw versions prior to 2026.4.8. This issue arises from missing entries in the environment variable denylist, allowing attackers to inject malicious build tool environment variables that influence host execution commands, leading to arbitrary code execution.

Impact

Exploitation of this vulnerability allows for arbitrary code execution on the host system.

Reproduction

The vulnerability can be reproduced by injecting malicious environment variables related to build tools, such as HGRCPATH, CARGO_BUILD_RUSTC_WRAPPER, RUSTC_WRAPPER, and MAKEFLAGS, into the execution environment. This can be done by configuring the environment variables before running OpenClaw, which will then process these variables during execution. The injected variables can be used to manipulate host execution commands, resulting in arbitrary code execution.

Remediation

Users can upgrade to OpenClaw version 2026.4.8 or later to address this vulnerability.

Added: Apr 28, 2026, 8:18 PM
Updated: Apr 28, 2026, 8:18 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
4.3
remediation
0.0
relevance
6.9
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.