NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · OpenClaw

CVE-2026-22168: OpenClaw has Windows system.run approval mismatch on cmd.exe /c trailing arguments

highCVSS 4.0 8.5GHSA-5v6x-rfc3-7qfr

On Windows nodes, OpenClaw's `system.run` approval check looked at only the first token after `cmd.exe /c`. Trailing arguments ran but did not show in the approval or audit text, so a benign-looking approval could cover a larger command. Versions before 2026.2.21 are affected. Upgrade the `openclaw` npm package to 2026.2.21.

Published Mar 2, 2026 · Updated Mar 19, 2026 · Analysis Oct 31, 2026

What an attacker can do

The approvals flow binds a human decision to a command string. For cmd.exe /c, extractShellCommandFromArgv returned just the single token after /c. A request for cmd.exe /c echo plus extra arguments was approved and logged as echo, while the node executed the full argument tail. This is argument injection (CWE-88) leading to incorrect authorization (CWE-863).

The advisory limits the preconditions: an authenticated operator context that uses the approvals flow, and a trusted Windows node. In the advisory's scenario, an operator approval is created for benign text such as echo, then a system.run request with trailing arguments reuses it. The attacker gets local command execution under the Windows node process account, and the audit trail records the wrong command. The reviewer who approves sees a harmless string, and the log later shows the same harmless string.

The CVSS 4.0 vector is local with low privileges. The advisory does not say the flaw is exploited in the wild.

Who is affected

Affected: the openclaw npm package before 2026.2.21 (the advisory names 2026.2.19-2 and earlier), on Windows nodes that handle system.run with approvals. Linux and macOS nodes are not described as affected by this cmd.exe path.

Check the version on the gateway and on each Windows node:

npm ls openclaw

For a global install, use npm ls -g openclaw.

openclaw

Ecosystem
npm
Affected
< 2026.2.21
Fixed in
2026.2.21
Check
npm ls openclaw

How to fix it

Upgrade to openclaw 2026.2.21:

npm install [email protected]

The fix (commit 6007941f) joins every argument after /c into one command string. A new resolveSystemRunCommand normalizes command and rawCommand, rejects a rawCommand that appears without command, and rejects one that does not match the argv. Validation, approval matching and execution/audit text now share the same path, and tests cover &&-style smuggling after /c. The advisory lists no workaround.

How to tell if you were hit

Compare approval records with what actually ran on Windows nodes. Process-creation logs (Sysmon event 1, or event 4688 with command-line auditing) show the full cmd.exe /c command line, which you can match against the approved text. Look for cmd.exe children of the node host whose command line is longer than the approved or audited command, especially with &, && or | after the first token.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

Summary

A Windows system.run approval-integrity mismatch in the cmd.exe /c path could allow trailing arguments to execute while approval/audit text reflected only a benign command string.

This requires an authenticated operator context using the approvals flow and a trusted Windows node.

Affected Packages / Versions

  • Package: openclaw (npm)
  • Latest published vulnerable version (as of 2026-02-21): 2026.2.19-2
  • Vulnerable range: <=2026.2.19-2
  • Patched version (planned next release): 2026.2.21

Attack Scenario

  1. An authenticated operator approval is created for a benign command text (for example, echo).
  2. A system.run request uses cmd.exe /c with extra trailing arguments.
  3. Prior behavior could bind approval/audit text to the benign command while still executing the full argument tail on the node.

Impact

  • Local command execution on the trusted Windows node process account.
  • Approval/audit command text integrity mismatch.

Fix

  • Canonicalize the full command tail after cmd.exe /c.
  • Reuse one shared command canonicalization/validation path for validation, approval matching, and execution/audit text.
  • Add regression coverage for trailing-argument smuggling and approval binding.

Fix Commit(s)

  • 6007941f04df1edcca679dd6c95949744fdbd4df

Release Process Note

patched_versions is pre-set to the planned next release (2026.2.21). Once that npm release is live, this advisory can be published directly.

OpenClaw thanks @tdjackey for reporting.

Credited to tdjackey.

Questions

Does CVE-2026-22168 need an operator to approve something?

It needs an authenticated operator context using the approvals flow and a trusted Windows node. The approval covers a benign command text, and extra trailing arguments run with it.

Does it affect non-Windows nodes?

The advisory describes the cmd.exe /c path on Windows. It does not report the same mismatch elsewhere.

Which version fixes it?

2026.2.21. Versions up to and including 2026.2.19-2 are affected.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More OpenClaw vulnerabilities

All OpenClaw entries