OpenClaw Compiler Binary Substitution Vulnerability via Environment Variable Override

Vulnerability

A vulnerability in OpenClaw versions prior to 2026.3.31 allows untrusted models to substitute key compiler binary environment variables, including CC, CXX, CARGO_BUILD_RUSTC, and CMAKE_C_COMPILER. This substitution is made possible through environment overrides on approved host execution requests, creating a risk that arbitrary code could be executed during build processes.

Impact

Exploitation of this vulnerability could lead to unauthorized execution of arbitrary code by substituting compiler binaries with malicious ones, which could then be executed during the build process.

Reproduction

The vulnerability can be reproduced by sending an approved host-exec request that includes overrides for the compiler binary environment variables. This can be done by specifying the desired substitutions in the environment overrides of the host-exec request. Once the overridden environment is applied, the substituted compiler binaries will be used, allowing for the execution of arbitrary code.

Remediation

Users can update to OpenClaw version 2026.3.31 or later, where this vulnerability has been patched.

Added: Apr 28, 2026, 9:53 PM
Updated: Apr 28, 2026, 9:53 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
10.0
exploitability
6.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.