Skip to content

fix(guardrails): close PowerShell-tool bypass of Bash-matched guards #915

Description

@kyle-sexton

f1 (proven live) + f3. Widen PreToolUse matchers Bash->Bash|PowerShell for the git/commit guards, and cover PowerShell file-writes (Set-Content/>) for the Write/Edit guards.

  • Define the canonical PowerShell commit form (here-string pipe equivalent of -F -) so a naive widen doesn't block every PS commit.
  • Conservative posture on unparseable PS: fail-closed on git commit-shaped PS text.
  • Shell-agnostic block messages (f3).
  • Full PS grammar parsing (here-strings/backticks/--%/subexpressions) is deferred to a follow-up (A2b). Independent.

Part of #912. Contract + design in #912 — do not diverge.

Metadata

Metadata

Assignees

Labels

area: securitySecurity-relevant: vulnerability, hardening, or disclosure follow-up.priority: highSignificant impact, or blocks an imminent release; staff this cycle.status: readyTriaged, unblocked, and fully specified; eligible to pick up.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions