Skip to content

guardrails(path-detection): fail-open regression LIVE on main — scan_text prefilter drops C:\Projects\ / C:\Dev\ machine paths #944

Description

@kyle-sexton

Lane: merge-drive (self-observation, rule 10)

SEVERITY: DEFER-FORBIDDEN (fail-open in a security guardrail) — LIVE ON main (c52e30ad).

Triggering example

A write whose only machine path is C:\Projects\acme\... or C:\Dev\acme\....

Observed

hpp::scan_text's cheap prefilter gate at plugins/guardrails/lib/path-detection/hardcoded-path-patterns.sh:74 is grep -qE 'Users|/home/|repos' — it early-returns (no match → skip) before the detailed scan. But the detailed Windows body HPP_WIN_REPO_BODY (plugins/guardrails/lib/path-detection/machine-path-patterns.sh:51) accepts repos|Repos|projects|Projects|dev|Dev. So Projects/Dev-only content is dropped by the prefilter and never reaches the body that would flag it = fail-open in the path-detection guardrail.

Expected

Prefilter alternation widened to Users|/home/|repos|Repos|projects|Projects|dev|Dev so the guardrail actually scans content containing the newer checkout roots. This is exactly the fix that HAD landed on PR #932 as commit 9a33e665 (widen gate + a Projects-root regression test).

Root cause (fleet incident)

PR #932's landed fix (9a33e665) was dropped by a concurrent same-identity force-push (d74e5e1 -> a318b5ac), then #932 was squash-merged (c52e30ad) in the fix-dropped state while still thread-blocked. Two compounding hazards:

  1. Concurrent branch mutation clobbered a DEFER-FORBIDDEN fix (recurrence of the known self-race class; worktree-safety / fix(source-control): assert babysit worktree HEAD == PR head before mutate; merge-only, upstream refspec push #895 territory).
  2. A thread-blocked PR carrying a known fail-open merged anyway — a merge-gate escape.

Remedy

0.9.8 fix-forward PR off main (guardrails 0.9.7 -> 0.9.8, new CHANGELOG entry newest-on-top): restore the prefilter gate + regression test (9a33e665), and fold the stale block_no_verify_enabled plugin.json description sync that also never landed.

Category: bug (security-posture) · observed vs expected: above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions