Executive brief
OpenClaw is a widely-used deployment and automation tool for managing applications on Windows systems. A command injection vulnerability in versions prior to 2026.2.18 allows attackers with influence over configuration or environment variables to execute arbitrary commands on Windows systems when scheduled tasks are generated, potentially leading to unauthorized code execution during system maintenance or deployment operations.
Technical details
The vulnerability is a command injection (CWE-78) in the Windows Scheduled Task script generation logic (src/daemon/schtasks.ts). Environment variables are written to gateway.cmd using unquoted set KEY=VALUE assignments, allowing shell metacharacters (&, |, ^, %, !) to break out of assignment context and alter command behavior in cmd.exe. Exploitation requires attacker ability to influence configuration or environment values (shared config templates, setup scripts, automation, or version control repos). When the scheduled task script is generated and executed, injected metacharacters enable arbitrary command execution. The fix (commit dafe52e8cf1a041d898cfb304a485fa05e5f58fb) uses quoted assignments with explicit escaping.
Affected products
- OpenClaw OpenClaw <= 2026.2.17
Timeline
- 2026-02-21: disclosed: Published as GHSA-pj5x-38rw-6fph
- 2026-02-19: patched: Patched version 2026.2.18 and later
- 2026-03-19: other: Duplicate advisory GHSA-82gw-wqw6-r2cf published and subsequently withdrawn on 2026-03-20