OpenClaw has a CWD `.env` environment variable injection which bypasses host-env policy and allows config takeover
Critical severity
GitHub Reviewed
Published
Mar 29, 2026
in
openclaw/openclaw
•
Updated Apr 20, 2026
Description
Published to the GitHub Advisory Database
Apr 1, 2026
Reviewed
Apr 1, 2026
Last updated
Apr 20, 2026
Summary
OpenClaw loaded the current working directory
.envbefore trusted state-dir configuration, allowing untrusted workspace state to inject host environment values.Impact
A repository or workspace containing a malicious
.envfile could override runtime configuration and security-sensitive environment settings when OpenClaw started there.Affected Component
src/infra/dotenv.ts, src/cli/dotenv.tsFixed Versions
<= 2026.3.24>= 2026.3.282026.3.28contains the fix.Fix
Fixed by commit
6a79324802(Filter untrusted CWD .env entries before OpenClaw startup).References