Summary
OpenClaw's node host system.run handler previously evaluated allowlist and approval prompts against a different command string than the one actually executed.
In deployments using node-based execution with allowlist-driven policies, an attacker able to invoke system.run could potentially get an unapproved command executed while a safer-looking command was shown for policy evaluation or user approval.
Affected context
This vulnerability affects OpenClaw deployments that:
- Use the node host / companion node execution path (i.e.,
system.runon a node), and - Enable an allowlist-based execution policy (e.g.,
security=allowlist), and - Drive approval prompts based on allowlist misses (e.g.,
ask=on-miss), and - Expose a path for an attacker to invoke
system.run.
Default configurations and non-node execution paths are not impacted.
Exploit preconditions
- Attack surface: The
system.runinterface on a node host or companion node. - Required access: Ability for an attacker (or compromised component) to trigger
system.runcalls with controllable command parameters. - Policy configuration: Execution policy must be allowlist-based (
security=allowlist) with approval prompting tied to allowlist misses (such asask=on-miss). - Trigger condition: A crafted request where the
rawCommandstring used for allowlist/approval evaluation does not accurately reflect thecommand[]argv actually executed. - Why exploitation is possible: Authorization and approval logic evaluate one representation of the command (
rawCommand), while the runtime uses a different representation (command[]), allowing disjoint policy decisions and execution behavior.
Why this happens
The core issue is an improper enforcement of authorization boundary where policy checks are not aligned with the actual action performed.
OpenClaw's node host system.run handler evaluated allowlist membership and approval decisions against rawCommand, but execution was driven by command[] (argv).
Because these two representations could diverge, an attacker could arrange for a benign-looking rawCommand to pass policy checks while a different, potentially more dangerous command[] executed.
This maps to CWE-284 (Improper Access Control), where the system enforces permissions on a surrogate or incomplete view of the action instead of the real, effective operation.
Potential impact
- Execution of commands that would normally be blocked by the allowlist policy.
- Bypassing user approval flows that are expected to gate new or risky commands.
- Escalation of capabilities within the node environment if
system.runcan invoke privileged or sensitive utilities. - Inconsistent audit trails, where recorded/approved commands differ from what actually ran.
General mitigation guidance
Effective mitigation centers on tightening the relationship between authorization checks and the actual executed action.
Recommended defensive patterns include:
- Ensuring that policy evaluation and approval prompts operate on the exact same command representation that the runtime will execute (e.g., canonicalized argv).
- Using a single source of truth for both allowlist matching and process spawning, avoiding parallel parameters that can diverge.
- Designing allowlist rules around normalized, structured command arguments rather than free-form strings, reducing ambiguity.
- Applying least-privilege execution for node processes so that even if a command bypasses policy, its impact is constrained.
- Implementing defensive logging that records both the policy-evaluated command and the executed argv for post-incident analysis, and alerting on mismatches.
How teams detect issues like this
Detection focuses on identifying mismatches between authorized commands and executed behavior:
- Static analysis / code review:
- Flag patterns where authorization or allowlist checks use a different variable or representation than the execution call.
- Review handlers like
system.runfor dual command fields (rawCommand,command[], etc.) and verify they are kept consistent. - Look for any transformation applied after the authorization step but before execution.
- Runtime monitoring:
- Log both the inputs used for allowlist/approval decisions and the final executed argv, and alert when they differ.
- Correlate user approvals with subsequent executed commands to detect unexpected changes.
- Policy enforcement:
- Incorporate automated checks (e.g., in CI/CD pipelines) ensuring that security policy decisions reference the same data structure passed to execution APIs.
- Use security testing or fuzzing focused on multi-field command interfaces to uncover inconsistency bugs.

