/

CVE-2026-22179

Severity:

HIGH RISK

(7.2)

Command Injection in OpenClaw macOS node-host system.run

CVE-2026-22179

Modified

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution on Host System

Severity:

HIGH RISK

(7.2)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OpenClaw node-host system.run on macOS contains a command injection vulnerability where allowlist-based command restrictions can be bypassed using shell command substitution syntax.

By embedding malicious commands within double-quoted text that is improperly parsed, a remote attacker may execute arbitrary, non-allowlisted commands on the underlying system.

Affected context

This vulnerability affects OpenClaw deployments on macOS that use the node-host system.run capability to execute shell commands with an allowlist-based security control.

The issue manifests when user-controlled input is incorporated into shell command lines and evaluated by a shell that supports command substitution (e.g., $(...) or backticks) inside double-quoted strings.

Environments that accept remote or untrusted input to drive system commands, scripts, or job execution through system.run are at heightened risk.

Exploit preconditions

  • Attack surface: Remote interfaces or APIs that expose OpenClaw node-host system.run or any feature that indirectly triggers it.
  • Required access: Ability to supply or influence command arguments, script content, or parameters that are passed into system.run.
  • Trigger point: Invocation of system.run where the application constructs a shell command string that includes attacker-controlled data, then passes it to a shell for execution.
  • Why exploitation is possible: The allowlist validation focuses on top-level commands but does not correctly account for command substitution tokens inside double-quoted segments, allowing hidden commands to be interpreted and executed by the shell.

Why this happens

The root cause lies in improper neutralization of special elements used in operating system commands, mapped to CWE-78.

OpenClaw relies on an allowlist to limit which commands can be executed, but the parsing logic assumes that double-quoted content is safe and does not fully inspect or neutralize command substitution constructs like $(...) or backtick expressions.

When a shell interprets the constructed string, it performs command substitution before executing the main command, enabling attacker-supplied subcommands to run regardless of the allowlist.

Conceptually, this is an insecure pattern where user input is embedded into shell commands and validated as plain text, while the actual execution semantics are governed by the shell's parsing rules, not the application's allowlist logic.

Potential impact

  • Execution of arbitrary commands that are not present in the intended allowlist
  • Unauthorized access to local files, environment variables, and system configuration on the macOS host
  • Lateral movement within the host environment or connected services accessible from that host
  • Data exfiltration, tampering, or destruction of application and user data
  • Installation of persistent malware or backdoors on the affected system

General mitigation guidance

Effective mitigation focuses on removing dependence on shell parsing and reducing the power of user-controlled input:

  • Prefer direct process invocation APIs that accept command and arguments as structured arrays, avoiding intermediate shells and their substitution rules.
  • Apply strict input validation and normalization, explicitly rejecting command substitution tokens (e.g., $(, `, ${), pipes, and other meta-characters when user input must be used in commands.
  • Implement context-aware allowlists at the argument level, not just the top-level command, and validate every user-controlled segment against expected patterns.
  • Run command-executing components under least-privilege accounts, restricting filesystem, network, and system capabilities to limit blast radius if exploitation occurs.
  • Adopt a secure-by-default configuration, disabling or minimizing dynamic command execution features where they are not strictly necessary.

How teams detect issues like this

Detection can combine code-level analysis with runtime monitoring:

  • Use static analysis or manual code review to locate all usages of system.run or equivalent wrappers that build shell command strings, especially those that concatenate user-controlled variables.
  • Flag patterns that pass full command lines to /bin/sh, /bin/bash, or similar shells, and that rely solely on allowlists without escaping or structural argument passing.
  • Introduce CI/CD checks that scan for command substitution tokens in templates, scripts, or code segments that construct shell commands using external input.
  • Employ runtime logging around command execution paths, capturing the final command line and arguments for anomaly detection and to identify unexpected embedded subcommands.

Sources

SourceLink
github.comgithub.com/openclaw/openclaw/commit/90a378ca3a9ecbf1634cd247f17a35f4612c6ca6
github.comgithub.com/openclaw/openclaw/security/advisories/GHSA-9p38-94jf-hgjj
vulncheck.comvulncheck.com/advisories/openclaw-allowlist-bypass-via-command-substitution-in-system-run

Frequently asked

questions

Yes, if OpenClaw is exposed through APIs, services, or workflows that allow remote users or integrated systems to control parameters passed into system.run. In such cases, a remote attacker can craft payloads that leverage command substitution to bypass the allowlist.

The attacker needs the ability to supply or influence the command text or arguments that are ultimately passed into system.run. This might be through HTTP requests, task definitions, configuration fields, or any other integration surface that feeds into command execution.

The most robust fix is to stop passing attacker-controlled data through a shell altogether. Use APIs that execute commands with explicit argument lists, validate those arguments against strict patterns, and avoid any reliance on shell features like command substitution, globbing, or pipelines.

Establish a development guideline that forbids direct concatenation of user input into shell commands, enforces parameterized process execution, and mandates security review for any feature that runs system commands. Complement this with automated checks that highlight shell use in security-sensitive paths and require explicit justification and review.

Find out what's already
exploitable in your codebase.