You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
guardrails: block-hook-bypass PowerShell lane skips the interpreter-producer scan (python3 -c write bypass) #1199
block-hook-bypass.sh classifies only PowerShell cmdlet/redirect write forms (ps::write_bypass) and then exit 0s before the shell-agnostic scans. So an interpreter-producer write — python3 -c "open('x','w').write('a')" — executes unguarded when issued through the PowerShell tool, while the identical command through the Bash tool is blocked.
Reproduced (CC 2.1.218, Windows)
Same command, both tools: Bash → BLOCKED; PowerShell → file written. This is a real write-gate bypass, not a firing problem — Bash|PowerShell PreToolUse hooks fire correctly for the PowerShell tool (payload tool_name is literally PowerShell).
Root cause
plugins/guardrails/hooks/block-hook-bypass.sh, PowerShell branch — the in-comment "deferred to A2b" gap. Interpreter-producer writes are shell-agnostic: whichever tool launches python3 -c, the write bypasses Write/Edit identically.
Fix
Run the interpreter rule on the PowerShell lane too, mirroring the Bash lane's two-part shape: detect the invocation in a quote-blanked form (ps::blank_quoted_spans, so a quoted mention stays inert) and scan the raw command for the write indicators (they legitimately live inside the quoted -c payload). PowerShell cmdlet/redirect coverage unchanged.
Acceptance
python3 -c "open('x','w')…" and pathlib.Path().write_text BLOCK under both tools.
A quoted mention and read-only os.path.normpath(…) stay quiet under PowerShell.
Activity
fix(guardrails): fail-closed on colon-bound computed launcher target …
fix(guardrails): conservatively fail-closed on any computed launcher …
fix(guardrails): close interpreter-producer write bypass under the Po…