Repository navigation
fix(privacy): validate denylist patterns with the scanning git grep engine - #26
Merged
Merged
Conversation
Contributor
Author
|
Same CI result as vllnt/skills#29: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Privacy Guardfails onmainwitherror: git grep failed(exit 2) ever since private patterns were loaded. The check validated each pattern with GNUgrep -E, but scanned withgit 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 asa{32768}. A pattern like that passed validation, then broke the scan.git grep --no-index -iEfor denylist patterns,grep -Efor the allowlist.\d,\x41,\Q…\E,\p) are rejected. Extended regex misreads them silently, so the guard missed text instead of failing.tracked,local,extra,allowlist) and the original line number, never the pattern text.Scope
scripts/privacy-denylist.sh,scripts/test-privacy-denylist.sh, CHANGELOG. Byte-identical mirror of vllnt/skills#29.This PR does NOT include
PRIVACY_DENYLIST_EXTRAsecret or to the workflow.Test plan
(?i),(?=x),(?!x)and\p{L}got through validation,\d,\x41and\Qpassed silently, and the source and line were not reported).bash scripts/test-privacy-denylist.shpasses, andbash scripts/privacy-denylist.shpasses on the tree.python3 -m unittest discover -s tests,python3 scripts/sync.py --check,git diff --check.Privacy Guardrun with the real secret either passes, or reports a line number for an unsupported construct.