Files
security-hooks/docs/superpowers
Flo a133271a6c Address Daria's review: tree-sitter, path matching, MCP injection
Changes based on reviewer feedback:

- Promote tree-sitter-bash to primary parser recommendation (over bash
  Hex package). Battle-tested grammar, robust against adversarial input.
- Fix path matching: directory-boundary matching instead of string prefix.
  reads_file("~/.ssh") no longer matches ~/.ssh_backup/key.
- Tilde expansion uses HOME from hook payload, not daemon environment.
  Correct for containers, remote SSH.
- MCP parameter injection: replaced regex with McpParameterInjection
  validator that runs string values through BashAnalyzer for consistency.
- Regex safety: add 1ms evaluation timeout to prevent catastrophic
  backtracking. Timed-out regex falls through to AST pass.
- Document that regex rules can only deny/suspect, never allow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 10:31:44 +02:00
..