Repository navigation
Description
Problem
Gateway node execution on Windows sends commands through the platform shell as an argv vector such as cmd.exe /d /s /c hostname. The Windows node formats that vector into one command string, evaluates the outer wrapper against the host exec policy, and returns on the default deny before ExecShellWrapperParser can evaluate the inner command.
This makes default low-risk allow rules such as the exact hostname rule unusable through the real Gateway exec host=node path even though direct Windows-node policy evaluation allows the inner command.
Reproduction
- Connect Windows Hub 0.6.12 as a node to a current OpenClaw Gateway.
- Confirm the host-native policy has the default exact
hostnameallow rule. - Ask an agent to run exactly
hostnamethroughexecwithhost=node. - Observe
Command denied by exec policy.
The Gateway-generated argv is cmd.exe /d /s /c hostname. The host policy denies that wrapper before expanding it to the allowed nested target.
Expected
A recognized shell wrapper should be allowed when every parsed inner target is allowed, while malformed wrappers and explicit deny rules on either the wrapper or any nested target remain fail-closed.
Scope
This is a narrow Windows host exec-policy ordering bug. It does not change the broader Windows-vs-WSL command/path product contract tracked in #911.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsLocal Gateway
Activity
clawsweeper commentedon Jul 11, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 11, 2026, 7:42 PM ET / 23:42 UTC.
Summary
Current main still exhibits the reported authorization ordering, so this issue remains necessary and is suitable for a narrow repair rather than closure or product-direction review.
Reproducibility: yes. at high confidence from current-main source:
cmd.exe /d /s /c hostnamefalls to the default outer denial before the existing parser can evaluatehostname. This read-only review did not execute the live Windows Gateway path.Root-cause cluster
Relationship:
canonicalCanonical: #971
Summary: This issue is the canonical narrow authorization-ordering report; the linked open issue covers a broader and distinct Windows-versus-WSL command contract.
Members:
adjacent_distinct: Gateway commands mix Linux vs Windows semantics + path confusion #911 - That issue concerns platform semantics and path confusion, while this issue concerns the host policy returning before recognized-wrapper expansion.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
Current main has a concrete, bounded ordering defect with clear implementation files and repository-defined validation, and no linked PR or product decision blocks a focused repair.
Security
Needs attention: The issue affects a command-authorization boundary, so the eventual repair needs focused proof that explicit deny and malformed-wrapper behavior remain fail-closed.
Review details
Best possible solution:
Parse recognized wrappers before finalizing an unmatched outer default denial, require every extracted target to pass policy, retain explicit deny precedence at every level, and prove the exact Gateway argv through the repository MXC E2E path.
Do we have a high-confidence way to reproduce the issue?
Yes at high confidence from current-main source:
cmd.exe /d /s /c hostnamefalls to the default outer denial before the existing parser can evaluatehostname. This read-only review did not execute the live Windows Gateway path.Is this the best way to solve the issue?
Yes: changing only the wrapper-evaluation ordering is the narrowest maintainable fix because the parser, nested-target checks, and explicit-deny distinction already exist.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 622c0e27c6b0.
Label changes
Label changes:
P1: An established default-safe Windows node command fails through the real Gateway agent workflow, breaking usable node command execution for affected users.impact:security: The issue affects the host command authorization boundary and requires preserving explicit deny and fail-closed semantics.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.clawsweeper:needs-security-review: Current issue advisory state selects this label.Label justifications:
P1: An established default-safe Windows node command fails through the real Gateway agent workflow, breaking usable node command execution for affected users.impact:security: The issue affects the host command authorization boundary and requires preserving explicit deny and fail-closed semantics.Evidence reviewed
Security concerns:
src/OpenClaw.Shared/Capabilities/SystemCapability.cs:550Reordering wrapper evaluation must not permit an allowed inner command to override an explicit rule denying the outer wrapper or any extracted target.
Confidence: 0.97
Acceptance criteria:
What I checked:
src/OpenClaw.Shared/Capabilities/SystemCapability.cs:550, 622c0e27c6b0)src/OpenClaw.Shared/ExecApprovalPolicy.cs:478, 622c0e27c6b0)src/OpenClaw.Shared/ExecShellWrapperParser.cs:76, 622c0e27c6b0)src/OpenClaw.Shared/Capabilities/SystemCapability.cs:569, 622c0e27c6b0)src/OpenClaw.Shared/Capabilities/SystemCapability.cs:541, e772b5e6e90c)Likely related people:
src/OpenClaw.Shared/Capabilities/SystemCapability.cs,src/OpenClaw.Shared/ExecApprovalPolicy.cs,src/OpenClaw.Shared/ExecShellWrapperParser.cs)src/OpenClaw.Shared/Capabilities/SystemCapability.cs,src/OpenClaw.Shared/ExecApprovalPolicy.cs)src/OpenClaw.Shared/Capabilities/SystemCapability.cs,tests/OpenClaw.Shared.Tests/ExecApprovalPolicyTests.cs)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.