Conversation
Allow-always could store powershell.exe /c and bash -l -c as reusable rules because those spellings were not treated as inline shells. - Treat PowerShell /c, /command, and colon-attached forms as wrappers - Treat POSIX -c, --command, and -lc in any argument after the shell name - Keep bash script.sh and bash -l script.sh bindable Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 24, 2026, 2:30 PM ET / 18:30 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch expands PowerShell and POSIX shell detection so more inline command forms are treated as one-time approvals, and adds focused normalizer and binder tests. Merge readiness⛔ Blocked before merge - 6 items remain This PR addresses a real gap in reusable command approvals, and current main does not contain the fix. Two parser boundary defects remain from the prior review: script arguments can be mistaken for inline shell commands. The upgrade effect on saved rules and real approval-path behavior also need resolution before merge. Priority: P2 Review scores
Verification
How this fits togetherThe Windows node receives command arguments from system.run and normalizes them before checking approval policy. That classification determines whether an approval can become a saved rule and whether a later command can use it. flowchart LR
A[system.run arguments] --> B[Shell form detection]
B --> C{Inline command?}
C -->|Yes| D[One-time approval]
C -->|No| E[Reusable command binding]
E --> F[Saved-rule match]
D --> G[Approved execution]
F --> G
Decision needed
Why: That fail-closed change affects existing approvals and requires an explicit compatibility and security choice. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Parse shell options only until the script operand, retain one-time treatment for actual inline commands, and document and prove the approved upgrade behavior for saved rules. Do we have a high-confidence way to reproduce the issue? Yes, the source gives a high-confidence binder path: the new scans classify a script argument as a wrapper and suppress reusable binding. This review did not execute it. Is this the best way to solve the issue? No. Recognizing the missing inline forms is appropriate, but scanning past a script operand breaks direct-script classification. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 273b0182745a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Signed-off-by: Sebastien Tardif <SebTardif@ncf.ca>
|
Global triage: HOLD_FOR_AUTHOR. Take confidence 5%; recommendation confidence 99%; effort medium; risk high. Three verified parsing gaps block this security-boundary change:
Please implement operand-aware, shell-specific option parsing and add saved-rule replay coverage for combined flags, post-script arguments, PowerShell The PR must declare and run The red hosted lanes are not linked to this patch: Core failed an unrelated bounded-cancellation test, the E2E shards failed during shared setup initialization, and CI Gate is derivative. They do not replace the missing MXC proof. |
What Problem This Solves
Fixes: Allow always can save
powershell.exe /candbash -l -cas a reusable rule, so a later identical script runs with no prompt.User Impact
User impact: those inline shell spellings stay one-shot. A direct program with arguments can still be saved.
Why This Change Was Made
The wrapper detector now treats PowerShell
/c,/command, and colon-attached forms as inline commands. POSIX-c,--command, and-lccount in any argument after the shell name, sobash -l -cis included.bash script.shandbash -l script.shstay direct commands.Evidence
Terminal output from commit
bbc8dfe0.The full
ExecApprovalV2NormalizationTestsclass earlier in this session: Passed 112, Failed 0.Change Type
Scope
winnodeRequired proof pools
none: the decision is argv classification. No approved command was executed.Validation
dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --filter "FullyQualifiedName~TryBind_InlineShell_IsNotReusable|FullyQualifiedName~Normalizer_BashLoginInlineCommand|FullyQualifiedName~Normalizer_PowerShellExeSlashC"onbbc8dfe0: Passed 9, Failed 0../build.ps1was not run for this commit.Real Behavior Proof
powershell.exe /candbash -l -cwere not inline shells, so Allow always could pin them.bbc8dfe0.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --filter "FullyQualifiedName~TryBind_InlineShell_IsNotReusable|FullyQualifiedName~Normalizer_BashLoginInlineCommand|FullyQualifiedName~Normalizer_PowerShellExeSlashC"TryBindwithShellWrapper.bash script.shandbash -l script.share not wrappers.Security Impact
NoNoNoYesNoYes, explain the risk and mitigation: More inline shell spellings stay prompt-only. Direct executables are unchanged.cmd /cbehavior is unchanged.Compatibility and Migration
YesNoNoReview Conversations