CVE-2026-32056: OpenClaw: RCE via shell env var injection in system.run
HIGHOpenClaw's system.run function fails to sanitize the HOME and ZDOTDIR shell environment variables, allowing a remote attacker with low-privilege access to inject malicious startup files (.bash_profile, .zshenv) that execute arbitrary code before the platform's command allowlist is evaluated — making that security control completely ineffective. Although EPSS sits at 0.56% with no public exploit or KEV listing, the underlying weakness is CWE-78 (OS Command Injection), a well-understood class, and the allowlist bypass substantially lowers the effective exploitation bar for any attacker who already holds a low-privilege foothold. OpenClaw is an AI agent framework where system.run is a core capability; successful exploitation hands an adversary direct shell access to the host running the agent, with blast radius extending to credentials, model artifacts, RAG data sources, and every downstream integration the agent reaches — a profile consistent with real-world credential-theft incidents already attributed to the OpenClaw ecosystem (AIID #1368). Upgrade to OpenClaw 2026.2.22 or later immediately; if patching is blocked, restrict system.run invocation to highly trusted roles, enforce strict environment variable allowlisting at the OS level, and audit all agent tool configurations for untrusted input paths.
What is the risk?
The CVSS 7.5 High rating is well-calibrated: network reachable, no user interaction, and full CIA impact offset by high attack complexity and the need for low-privilege credentials. In AI agent deployments, however, those prerequisites are often easy to satisfy — agents routinely accept external user inputs as part of their function, and low-privilege API tokens are widely distributed. The allowlist bypass is the critical aggravating factor: operators who believed system.run was sandboxed by the allowlist have been operating with a false sense of security. With 396 CVEs in the same package and 4 downstream dependents, the package's security hygiene history is a concern. Effective risk is moderate-to-high for any organisation running OpenClaw in a networked or multi-tenant AI agent environment.
How does the attack unfold?
What systems are affected?
How severe is it?
What is the attack surface?
What should I do?
5 steps-
Patch: upgrade OpenClaw to version 2026.2.22 or later — the patch commit (c2c7114e) explicitly sanitises HOME and ZDOTDIR before shell invocation.
-
Interim workaround: restrict system.run to a controlled service account; explicitly set HOME and ZDOTDIR to trusted fixed paths in the process environment before any OpenClaw invocation using wrapper scripts or systemd environment directives.
-
Detection: monitor for unexpected shell startup file modifications (.bash_profile, .zshenv, .bashrc) in directories writable by the OpenClaw service account; alert on shell processes spawned by OpenClaw that execute binaries not on the approved allowlist.
-
Review: audit all OpenClaw agent configurations for inputs that flow into system.run without sanitisation; check for credential exposure if the service account has broad access.
-
Dependency review: evaluate the 4 downstream dependents for indirect exposure.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-32056?
OpenClaw's system.run function fails to sanitize the HOME and ZDOTDIR shell environment variables, allowing a remote attacker with low-privilege access to inject malicious startup files (.bash_profile, .zshenv) that execute arbitrary code before the platform's command allowlist is evaluated — making that security control completely ineffective. Although EPSS sits at 0.56% with no public exploit or KEV listing, the underlying weakness is CWE-78 (OS Command Injection), a well-understood class, and the allowlist bypass substantially lowers the effective exploitation bar for any attacker who already holds a low-privilege foothold. OpenClaw is an AI agent framework where system.run is a core capability; successful exploitation hands an adversary direct shell access to the host running the agent, with blast radius extending to credentials, model artifacts, RAG data sources, and every downstream integration the agent reaches — a profile consistent with real-world credential-theft incidents already attributed to the OpenClaw ecosystem (AIID #1368). Upgrade to OpenClaw 2026.2.22 or later immediately; if patching is blocked, restrict system.run invocation to highly trusted roles, enforce strict environment variable allowlisting at the OS level, and audit all agent tool configurations for untrusted input paths.
Is CVE-2026-32056 actively exploited?
No confirmed active exploitation of CVE-2026-32056 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-32056?
1. Patch: upgrade OpenClaw to version 2026.2.22 or later — the patch commit (c2c7114e) explicitly sanitises HOME and ZDOTDIR before shell invocation. 2. Interim workaround: restrict system.run to a controlled service account; explicitly set HOME and ZDOTDIR to trusted fixed paths in the process environment before any OpenClaw invocation using wrapper scripts or systemd environment directives. 3. Detection: monitor for unexpected shell startup file modifications (.bash_profile, .zshenv, .bashrc) in directories writable by the OpenClaw service account; alert on shell processes spawned by OpenClaw that execute binaries not on the approved allowlist. 4. Review: audit all OpenClaw agent configurations for inputs that flow into system.run without sanitisation; check for credential exposure if the service account has broad access. 5. Dependency review: evaluate the 4 downstream dependents for indirect exposure.
What systems are affected by CVE-2026-32056?
This vulnerability affects the following AI/ML architecture patterns: AI agent frameworks, Agentic task orchestration pipelines, Multi-agent systems with shell execution capabilities, CI/CD pipelines with AI enrichment steps, RAG pipelines with agent-orchestrated retrieval.
What is the CVSS score for CVE-2026-32056?
CVE-2026-32056 has a CVSS v3.1 base score of 7.5 (HIGH). The EPSS exploitation probability is 0.56%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0049 Exploit Public-Facing Application AML.T0050 Command and Scripting Interpreter AML.T0053 AI Agent Tool Invocation AML.T0107 Exploitation for Defense Evasion Compliance Controls Affected
What are the technical details?
Original Advisory
OpenClaw versions prior to 2026.2.22 fail to sanitize shell startup environment variables HOME and ZDOTDIR in the system.run function, allowing attackers to bypass command allowlist protections. Remote attackers can inject malicious startup files such as .bash_profile or .zshenv to achieve arbitrary code execution before allowlist-evaluated commands are executed.
Exploitation Scenario
An adversary with a low-privilege API token for an OpenClaw-based AI agent — obtained via phishing, credential stuffing, or a leaked CI/CD secret — crafts a request to the agent that triggers a system.run call while supplying a manipulated HOME or ZDOTDIR environment variable pointing to an attacker-controlled directory hosted on a shared or writable path. When OpenClaw's shell spawns, it reads the injected .zshenv or .bash_profile before evaluating any allowlisted commands; that startup file executes a reverse shell or downloads a credential-harvesting binary. Because execution happens before the allowlist gate, no command-restriction policy fires. The attacker then moves laterally using credentials found in the agent's environment — Anthropic API keys, database connection strings, Stripe secrets — achieving persistence by planting backdoors in the model artifact store or RAG ingestion pipeline.
Weaknesses (CWE)
CWE-78 — Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'): The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
- [Architecture and Design] If at all possible, use library calls rather than external processes to recreate the desired functionality.
- [Architecture and Design, Operation] Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H References
- github.com/openclaw/openclaw/commit/c2c7114ed39a547ab6276e1e933029b9530ee906 patch
- github.com/openclaw/openclaw/security/advisories/GHSA-xgf2-vxv2-rrmg vendor-advisory
- vulncheck.com/advisories/openclaw-remote-code-execution-via-shell-startup-environment-variable-injection-in-system-run third-party-advisory
Timeline
Related Vulnerabilities
CVE-2026-33579 9.9 OpenClaw: scope bypass escalates low-priv to admin
Same package: openclaw CVE-2026-32922 9.9 OpenClaw: privilege escalation to RCE via token scope bypass
Same package: openclaw CVE-2026-30741 9.8 OpenClaw: RCE via request-side prompt injection
Same package: openclaw CVE-2026-32038 9.8 OpenClaw: sandbox bypass enables container lateral movement
Same package: openclaw CVE-2026-53838 9.8 OpenClaw: approval scope bypass via reconnection state
Same package: openclaw