The vulnerability, identified as GHSA-6rcp-vxwf-3mfp, allows for hidden command execution in OpenClaw's system.run function. The root cause is a discrepancy between the command string displayed to the user for approval and the actual command arguments (argv) that are executed. This is particularly problematic with shell wrappers (e.g., /bin/sh -c '...') where an attacker can provide a seemingly benign inline script for the approval text, while hiding malicious commands in subsequent positional arguments.
The analysis of the two fix commits (0f0a680d3df81739ea5088a2f88e65f938b7936b and 55cf92578d266987e390c4bf688196af98eac748) reveals that the vulnerability affected both the main Node.js application and its macOS companion execution host.
In the Node.js part, the functions resolveSystemRunCommand and validateSystemRunCommandConsistency in src/infra/system-run-command.ts were flawed. resolveSystemRunCommand generated an incomplete display text for approval, and validateSystemRunCommandConsistency failed to detect the mismatch between this incomplete text and the full command line. The function handleSystemRunInvoke then propagated this misleading information to the macOS companion.
In the macOS companion app, the ExecHostExecutor.execute function in apps/macos/Sources/OpenClaw/ExecApprovalsSocket.swift blindly trusted the command string it received, displaying it for approval without independent validation.
The fix involves two main changes: 1) The Node.js code was updated to always bind the approval/display text to the full, formatted argv string for these shell-wrapper forms. 2) The macOS companion app now performs its own validation to ensure the command it displays for approval is consistent with the one that will be executed.