CVE-2026-22176

OpenClaw < 2026.2.19 - Command Injection via Unescaped Environment Variables in Windows Scheduled Task Script Generation

Published Mar 19, 2026 CVSS 4.0 · 6.9 Medium EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
Type Values Removed Values Added
Metrics ssvc

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

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'}

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jun 23, 2026, 4:13 PM
Reserved
Jan 6, 2026, 4:47 PM
Status
Analyzed
Published
Mar 19, 2026, 2:16 AM
Modified
Jun 17, 2026, 10:19 AM