Repository navigation
fix(guardrails): match git in command position only - #2622
Conversation
PowerShell scripts that only mention .git as a directory name were blocked because the dangerous-git guard matched the substring "git". Require git in command position so classification arrays stay allowed. Closes #2592. Co-authored-by: Kyle Sexton <[email protected]>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 5m 28s —— View job Security review complete
1 IMPORTANT finding, posted inline on The new command-position Concrete bypass — both route to the fail-closed sink (via 1..1 | ForEach-Object {$x=git reset --hard}
if($x=git reset --hard){}This is the mirror image of the PR's own positive-control test at Suggested fix: add Note: No other security issues found in the version bump ( |
|
Claude finished @kyle-sexton's task in 5m 22s —— View job Code review (
|
The #2592 regression fixture uses a Git\bin Windows path string; mark it portability-ok like sibling PowerShell fixture tests. Co-authored-by: Kyle Sexton <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7b3aa3403c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Include ':' in the command-position predecessor class so PowerShell drive-relative git paths stay blocked (Codex review on #2592). Co-authored-by: Kyle Sexton <[email protected]>
|
Last security-reviewed head: |
Include '=' in the command-position predecessor class so PowerShell `$x=git reset --hard` (no spaces) remains blocked (Claude review on #2592). Co-authored-by: Kyle Sexton <[email protected]>
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
Strip PowerShell `$var=` / `$var+=` prefixes when reducing for the Bash hand-off so bare `$x=git reset --hard` is blocked, not only braced forms caught by the `=` predecessor class. Co-authored-by: Kyle Sexton <[email protected]>
|
Claude finished @cursor[bot]'s task in 5m 6s —— View job Code review (
|
Closes #2592
Summary
block-dangerous-gitengaged on PowerShell that never invokedgit, because substring matching treated.gitdirectory names as git commands, then failed closed on ordinaryForEach-Object { }grouping.Fix
Require
gitin command position for PowerShell (not substring matches inside.git/ path fragments). Keep real git invocations blocked. Added regression tests.Verification
bash plugins/guardrails/hooks/block-dangerous-git.test.sh→ PASS=395 FAIL=0Related
Refs #2594 — separate Windows
/tmp→C:\tmpguard (Wave 3/guardrails lane).