Openclaw cli: OpenClaw shell-env fallback trusted startup env and could execute attacker-influenced login-shell paths
Description
OpenClaw CLI versions from 2026.1.5 up to and including 2026.2.21-2 contain a vulnerability in the shell environment fallback mechanism. The issue involves trusting environment variables such as SHELL, HOME, and ZDOTDIR during startup, which could allow execution of attacker-influenced login shell startup paths before environment keys are loaded. This can lead to local code execution if an attacker can influence environment or configuration input. The vulnerability is not exploitable remotely and depends on crossing local trusted operator boundaries. A fix is available in the mainline and planned for release in version 2026.2.22, which hardens environment variable handling and sanitizes the shell fallback execution environment.
CVSS v3.1
Score 5.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in OpenClaw CLI affects the shell-env fallback startup process where environment variables like SHELL, HOME, and ZDOTDIR were trusted and used to execute login shell commands. Specifically, the code executed `${SHELL} -l -c "env -0"` with inherited runtime environment, allowing attacker-influenced environment variables to trigger unintended command execution. The fix involves blocking these variables during config environment ingestion, sanitizing the shell fallback environment by pinning HOME to the real user home and dropping ZDOTDIR and other dangerous startup variables, and adding regression tests. This vulnerability allows local code execution under conditions where attacker-controlled environment or config input reaches the shell-env fallback, but it is not a public remote vulnerability.
Potential Impact
The impact is a local code execution risk in environments where an attacker can influence environment or configuration inputs that reach the shell-env fallback in OpenClaw CLI. This could lead to execution of arbitrary commands in the context of the OpenClaw host process. The vulnerability requires local access and crossing of trusted operator boundaries, so it is not exploitable remotely. Confidentiality, integrity, and availability impacts are rated low to medium given the local and privilege requirements.
Mitigation Recommendations
A fix is available and planned for release in OpenClaw CLI version 2026.2.22. The fix hardens environment variable handling by blocking SHELL, HOME, and ZDOTDIR during configuration environment ingestion and sanitizes the shell fallback execution environment. Users should upgrade to version 2026.2.22 or later once released. Until then, avoid running OpenClaw CLI in environments where untrusted users can influence environment or configuration inputs that affect shell fallback execution. No additional mitigations are indicated by the vendor advisory.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-openclaw-cli-GHSA-5h2c-8v84-qpvr
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6ac2458812601ec6a31640a6
Added to database: 10/04/2026, 12:24:40 UTC
Last enriched: 10/04/2026, 12:33:34 UTC
Last updated: 10/04/2026, 12:33:34 UTC
Views: 1
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.