Description
OpenClaw versions prior to 2026.2.19 contain a command injection vulnerability in Windows Scheduled Task script generation where environment variables are written to gateway.cmd using unquoted set KEY=VALUE assignments, allowing shell metacharacters to break out of assignment context. Attackers can inject arbitrary commands through environment variable values containing metacharacters like &, |, ^, %, or ! to achieve command execution when the scheduled task script is generated and executed.
Published: 2026-03-19
Score: 6.9 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Command Injection resulting in arbitrary code execution.
Action: Immediate Patch
AI Analysis

Impact

The vulnerability is a command injection in OpenClaw’s Windows Scheduled Task script generation. Because environment variables are written to gateway.cmd using unquoted set KEY=VALUE assignments, attackers can inject shell metacharacters such as &, |, ^, %, or ! into environment variable values to break out of the assignment context. This allows execution of arbitrary commands when the scheduled task script is generated and later executed, giving attackers the ability to run code with the permissions of the scheduled task. The weakness is identified as CWE‑78: Improper Neutralization of Special Elements used in a Command.

Affected Systems

The vulnerability affects OpenClaw (OpenClaw) versions older than 2026.2.19. No specific sub‑versions are listed, so any build prior to that release is considered vulnerable.

Risk and Exploitability

The CVSS base score is 6.9, indicating a moderate severity. No EPSS data is available, and the vulnerability is not listed in the CISA KEV catalog. The likely attack vector is inferred: an attacker must provide a value for an environment variable that influences the script generation; this could be achieved remotely via an interface that accepts custom environment variables or locally by setting environment variables before invoking the vulnerable code. Because the injection occurs during script generation, successful exploitation requires access that can cause the script to be generated and run. Given the moderate CVSS score and absence of observable exploit in the public domain, immediate remediation is recommended to prevent potential code execution.

Generated by OpenCVE AI on March 19, 2026 at 02:26 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade OpenClaw to version 2026.2.19 or later
  • Verify that environment variable values do not contain unescaped shell metacharacters before they are written to gateway.cmd

Generated by OpenCVE AI on March 19, 2026 at 02:26 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-pj5x-38rw-6fph OpenClaw has a Command Injection via unescaped environment assignments in Windows Scheduled Task script generation
History

Mon, 23 Mar 2026 17:15:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Thu, 19 Mar 2026 01:30:00 +0000

Type Values Removed Values Added
Description OpenClaw versions prior to 2026.2.19 contain a command injection vulnerability in Windows Scheduled Task script generation where environment variables are written to gateway.cmd using unquoted set KEY=VALUE assignments, allowing shell metacharacters to break out of assignment context. Attackers can inject arbitrary commands through environment variable values containing metacharacters like &, |, ^, %, or ! to achieve command execution when the scheduled task script is generated and executed.
Title OpenClaw < 2026.2.19 - Command Injection via Unescaped Environment Variables in Windows Scheduled Task Script Generation
First Time appeared Openclaw
Openclaw openclaw
Weaknesses CWE-78
CPEs cpe:2.3:a:openclaw:openclaw:*:*:*:*:*:node.js:*:*
Vendors & Products Openclaw
Openclaw openclaw
References
Metrics cvssV3_1

{'score': 6.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L'}

cvssV4_0

{'score': 6.9, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N'}


Subscriptions

Openclaw Openclaw
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-03-23T16:56:37.496Z

Reserved: 2026-01-06T16:47:17.180Z

Link: CVE-2026-22176

cve-icon Vulnrichment

Updated: 2026-03-23T16:46:01.264Z

cve-icon NVD

Status : Analyzed

Published: 2026-03-19T02:16:01.733

Modified: 2026-03-19T19:20:20.697

Link: CVE-2026-22176

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-03-25T11:51:37Z

Weaknesses