Executive brief
OpenClaw is a development tool that manages environment configuration and runtime settings. An attacker who can place a malicious .env file in a workspace or repository can override critical security settings and runtime configuration when OpenClaw starts in that directory, potentially leading to unauthorized access, data theft, or system compromise.
Technical details
The vulnerability is an untrusted search path issue (CWE-426) in OpenClaw's dotenv loading logic. OpenClaw was loading environment variables from a .env file in the current working directory before applying trusted configuration from the state directory, allowing an attacker to inject malicious environment variables that override security-sensitive settings. The vulnerable components are src/infra/dotenv.ts and src/cli/dotenv.ts. Attack requires user interaction (the user must start OpenClaw in a directory containing the malicious .env file), but no authentication is needed. The fix, released in version 2026.3.28, filters untrusted CWD .env entries before startup (commit 6a79324802).
Affected products
- OpenClaw OpenClaw <= 2026.3.24
Timeline
- 2026-04-01: disclosed
- 2026-03-28: patched: Version 2026.3.28 and later contain the fix
- 2026-03-25: other: Fix committed (commit 6a793248024dca7685f63bcceb64a0096fd1586d)