Executive brief
OpenClaw is an AI automation platform that executes tasks across operating systems and platforms. The vulnerability affects how it validates environment variable overrides when running system commands—a core mechanism for executing scripts and tools. An authenticated attacker could potentially inject or modify environment variables that should have been blocked, potentially leading to unauthorized access, privilege escalation, or execution of malicious code within the context of those system commands.
Technical details
This vulnerability is a sanitization bypass (CWE-15: External Control of System or Configuration Setting) in OpenClaw's gateway host execution layer. The root cause is inconsistent validation of environment variable override keys across multiple execution paths: the bash-tools.exec component and node-host invoke-system-run module each applied their own partial sanitization logic instead of using a shared validator. Blocked or malformed keys could slip through certain paths. The attack requires authentication (PR:L in CVSS v3) and network access, with no UI interaction required. An attacker with valid credentials could supply crafted environment overrides to execute system commands with modified environments, potentially escalating privileges or accessing sensitive data. The fix (commit 7abfff7) consolidates sanitization into src/infra/host-env-security.ts with fail-closed diagnostics, and routes all overrides through this shared validator before command execution. The patch was released in v2026.3.22 and remains present in later versions (v2026.3.23 and v2026.3.23-2).
Affected products
- OpenClaw openclaw < 2026.3.22
Timeline
- 2026-03-26: disclosed: GHSA advisory published
- 2026-03-22: patched: Fix released in version 2026.3.22
- 2026-04-10: advisory: NVD entry published
References
- https://github.com/openclaw/openclaw/security/advisories/GHSA-39pp-xp36-q6mg
- https://github.com/openclaw/openclaw/commit/630f1479c44f78484dfa21bb407cbe6f171dac87
- https://github.com/openclaw/openclaw/commit/7abfff756d6c68d17e21d1657bbacbaec86de232
- https://github.com/openclaw/openclaw
- https://www.vulncheck.com/advisories/openclaw-environment-variable-override-bypass-via-inconsistent-sanitization