Skip to content

fix(privacy): validate denylist patterns with the scanning git grep engine - #26

Merged
bntvllnt merged 1 commit into
mainfrom
fix/privacy-denylist-engine
Oct 31, 2026
Merged

bntvllnt merged 1 commit into
mainfrom
fix/privacy-denylist-engine

Conversation

@bntvllnt

@bntvllnt bntvllnt commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Privacy Guard fails on main with error: git grep failed (exit 2) ever since private patterns were loaded. The check validated each pattern with GNU grep -E, but scanned with git grep -iE, and the two regex dialects differ. GNU grep accepts constructs that git grep rejects: (?i), lookarounds such as (?=x) and (?!x), \p{L}, and large repeat counts such as a{32768}. A pattern like that passed validation, then broke the scan.

  • Validation now runs each pattern with the engine and flags that will use it: git grep --no-index -iE for denylist patterns, grep -E for the allowlist.
  • PCRE-only escapes (\d, \x41, \Q…\E, \p) are rejected. Extended regex misreads them silently, so the guard missed text instead of failing.
  • CR characters and blank lines are stripped from private patterns.
  • Errors name only the source (tracked, local, extra, allowlist) and the original line number, never the pattern text.
  • An invalid pattern still exits with 2.

Scope

scripts/privacy-denylist.sh, scripts/test-privacy-denylist.sh, CHANGELOG. Byte-identical mirror of vllnt/skills#29.

This PR does NOT include

  • Changes to the PRIVACY_DENYLIST_EXTRA secret or to the workflow.
  • New denylist patterns.

Test plan

  • RED: the new tests failed before the fix (8 failures: (?i), (?=x), (?!x) and \p{L} got through validation, \d, \x41 and \Q passed silently, and the source and line were not reported).
  • GREEN: bash scripts/test-privacy-denylist.sh passes, and bash scripts/privacy-denylist.sh passes on the tree.
  • python3 -m unittest discover -s tests, python3 scripts/sync.py --check, git diff --check.
  • The CI Privacy Guard run with the real secret either passes, or reports a line number for an unsupported construct.

@bntvllnt bntvllnt self-assigned this Oct 31, 2026
@bntvllnt

Copy link
Copy Markdown
Contributor Author

Same CI result as vllnt/skills#29: Check denylist reports extra pattern line 1 is not a valid regex. The secret needs rewriting, and this PR does not change it. Merging on green required checks.

@bntvllnt
bntvllnt merged commit 551694c into main Oct 31, 2026
4 of 6 checks passed
@bntvllnt
bntvllnt deleted the fix/privacy-denylist-engine branch October 31, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant