Openclaw cli: OpenClaw has a CWD `.env` environment variable injection which bypasses host-env policy and allows config takeover (CVE-2026-41294)
Description
OpenClaw CLI versions up to 2026.3.24 have a vulnerability where the current working directory's .env file is loaded before the trusted configuration directory. This allows an attacker with control over the workspace to inject environment variables that override runtime configuration and security-sensitive settings. The issue is fixed in version 2026.3.28 and later.
CVSS v3.1
Score 9.6critical
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
OpenClaw CLI improperly loads the .env file from the current working directory before loading the trusted state-dir configuration. This behavior allows an untrusted workspace or repository containing a malicious .env file to inject environment variables that override host environment settings, potentially leading to configuration takeover. The vulnerability affects source files src/infra/dotenv.ts and src/cli/dotenv.ts. The issue is fixed in version 2026.3.28 by filtering untrusted CWD .env entries before OpenClaw startup.
Potential Impact
An attacker who can place a malicious .env file in a repository or workspace can override runtime configuration and security-sensitive environment variables when OpenClaw starts in that directory. This can lead to complete compromise of the host environment, including confidentiality, integrity, and availability impacts as indicated by the CVSS score of 9.6.
Mitigation Recommendations
A fix is available and included in OpenClaw CLI version 2026.3.28 and later. Users should upgrade to version 2026.3.28 or newer to mitigate this vulnerability. No additional mitigation steps are required once the update is applied.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- BREW-openclaw-cli-CVE-2026-41294
- Osv Schema Version
- 1.7.3
- Ecosystems
- ["Homebrew"]
- Cvss Version
- 3.1
Threat ID: 6ac245a812601ec6a31661b2
Added to database: 10/04/2026, 12:25:12 UTC
Last enriched: 10/04/2026, 12:52:05 UTC
Last updated: 10/04/2026, 16:08:38 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.
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.