CVE-2026-41373: OpenClaw: Incomplete host-env-security-policy allows untrusted model to substitute compiler binaries via env overrides
OpenClaw up to 2026.3.28 did not block compiler override variables such as CC, CXX, CARGO_BUILD_RUSTC and CMAKE_C_COMPILER in host exec requests. An untrusted model that gets a host exec request approved can swap in its own compiler binary and run it. Fixed in 2026.3.31.
Published Apr 3, 2026 · Updated May 6, 2026 · Analysis Oct 30, 2026
What an attacker can do
OpenClaw strips dangerous environment overrides from host command requests using a list in host-env-security-policy.json. In v2026.3.28 the list missed the variables that name the compiler. A model could attach CC=/path/to/binary to an approved request such as make. The build tool then runs the model's chosen program in place of the compiler, so a command the user approved does something different from what they expected.
The maintainers rate it medium and call it narrow. Exploitation needs an approved host-exec request inside the existing exec trust domain, and the CVSS vector says local access with low privileges. A prompt-injected agent that can write a file and ask for an approved build command is the realistic path. The result is arbitrary code execution as the user running OpenClaw, which affects integrity most.
Who is affected
The npm package openclaw, versions 2026.3.28 and earlier. The risk applies where the agent can request host execution of build tools that honour compiler variables, such as make, cargo and cmake. Check the version:
npm ls openclaw
openclaw --versionopenclaw
- Ecosystem
- npm
- Affected
- <= 2026.3.28
- Fixed in
- 2026.3.31
- Check
npm ls openclaw
How to fix it
Upgrade to openclaw 2026.3.31, the first stable tag containing the fix.
npm install -g [email protected]The fix commit adds five names to the blocked list, in the JSON policy and the generated macOS policy file: CC, CXX, CARGO_BUILD_RUSTC, CMAKE_C_COMPILER and CMAKE_CXX_COMPILER. Matching is case-insensitive. A regression test shows that a Makefile using the CC variable no longer runs the substituted compiler. The sources give no workaround.
How to tell if you were hit
Review approved host exec requests for environment overrides that set CC, CXX, CARGO_BUILD_RUSTC or CMAKE_C_COMPILER, particularly with a path inside a workspace or temp directory. Look for freshly written executables that were then run as a compiler. Beam records agent shell commands and file access, so its logs would show a build command run with a compiler override and the file written just before it.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
Summary
Incomplete host-env-security-policy.json allows untrusted model to substitute compiler binaries (CC, CXX, CARGO_BUILD_RUSTC, CMAKE_C_COMPILER) via env overrides on approved host exec requests
Current Maintainer Triage
- Status: narrow
- Normalized severity: medium
- Assessment: Shipped v2026.3.28 host-env policy missed compiler override vars, but exploitation still requires an approved host-exec request inside the existing exec trust domain, so medium not high.
Affected Packages / Versions
- Package:
openclaw(npm) - Latest published npm version:
2026.3.31 - Vulnerable version range:
<=2026.3.28 - Patched versions:
>= 2026.3.31 - First stable tag containing the fix:
v2026.3.31
Fix Commit(s)
e277a37f896b5011a1df06e6490c6630074d0afa— 2026-03-30T20:06:32+01:00
OpenClaw thanks @tdjackey for reporting.
Credited to tdjackey.
Questions
- Which version fixes the compiler override problem?
OpenClaw 2026.3.31. Versions up to and including 2026.3.28 are affected. The fix commit is e277a37.
- Does the attacker need approval from the user?
Yes, in effect. The maintainers say exploitation needs an approved host-exec request within the existing exec trust domain, which is why they rate it medium.
- How does it differ from the broader environment variable issue?
This fix covers five compiler variables. A separate fix, CVE-2026-41369, adds 26 more names for package managers, Docker, Go and TLS settings. Both ship in 2026.3.31.
References
Read for this analysis:
- https://github.com/openclaw/openclaw/security/advisories/GHSA-g8xp-qx39-9jq9
- https://github.com/openclaw/openclaw/releases/tag/v2026.3.31
- https://nvd.nist.gov/vuln/detail/CVE-2026-41373
- https://www.vulncheck.com/advisories/openclaw-compiler-binary-substitution-via-environment-variable-override-in-host-execution-policy
- https://github.com/advisories/GHSA-g8xp-qx39-9jq9
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More OpenClaw vulnerabilities
All OpenClaw entriesCVE-2026-62197
OpenClaw: Browser CDP discovery could accept blocked WebSocket URLs
medium8.5Oct 21, 2026CVE-2026-35630
OpenClaw: QQBot native approval buttons did not enforce configured approver identity
high8.0Jul 2, 2026CVE-2026-53806
OpenClaw: Combined POSIX shell options could confuse exec revalidation
high8.8Jul 2, 2026CVE-2026-53809
OpenClaw: Embedded runner policy could be confused by provider aliases
medium3.8Jul 2, 2026CVE-2026-53810
OpenClaw's marketplace runtime extension metadata could point at unscanned payloads
high8.8Jul 2, 2026CVE-2026-53811
OpenClaw: Matrix allowFrom could bind to mutable display names
high8.8Jul 2, 2026
