fix(security): fail closed when shell candidates are absent - #1747
Merged
Conversation
Aaronontheweb
commented
Aug 3, 2026
Aaronontheweb
left a comment
Collaborator
Author
There was a problem hiding this comment.
LGTM - tightly targeted fix in the event that ShellSyntaxTree can't make heads or tails of the command being parsed
Aaronontheweb
enabled auto-merge (squash)
August 3, 2026 21:43
There was a problem hiding this comment.
Pull request overview
This pull request fixes a security bug in the tool approval gate for shell_execute.
It makes the shell approval exemption fail closed when the matcher extracts zero candidates.
Changes:
- Require a nonempty extracted candidate set before
ApprovalExemptShellCandidatescan allow a shell call. - Keep zero-candidate shell calls at
RequiresApproval, including parser rejection cases. - Add evaluator tests for empty input, whitespace input, five exempt commands, and “no execution during authorization” proof.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Netclaw.Actors/Tools/DispatchingToolExecutor.cs | Prevents an empty candidate set from being treated as an approval-exempt proof. |
| src/Netclaw.Actors.Tests/Tools/DispatchingToolExecutorTests.cs | Adds regression tests that cover the fail-closed behavior and exemption cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RequiresApproval.Validation
dotnet test Netclaw.slnx --no-restoredotnet slopwatch analyzepwsh ./scripts/Add-FileHeaders.ps1 -Verifygit diff --checkCloses #1746