Skip to content

fix(privacy): validate denylist patterns with the scanning regex engine - #24

Closed
bntvllnt wants to merge 2 commits into
mainfrom
fix/privacy-guard-validate-with-git-grep
Closed

bntvllnt wants to merge 2 commits into
mainfrom
fix/privacy-guard-validate-with-git-grep

Conversation

@bntvllnt

Copy link
Copy Markdown
Contributor

Summary

Since PRIVACY_DENYLIST_EXTRA was set, Privacy Guard fails on every run, including unchanged main, with error: git grep failed (exit 2). The guard validated patterns with GNU grep -E but scans with git grep -E. They disagree on PCRE syntax: (?i), (?:...), lookarounds and \p{..} compile under GNU grep and are fatal in git grep. A secret pattern using one passed validation and then killed the scan with no hint which line.

This validates denylist patterns with git grep -E, so the failure names the pattern by index (denylist pattern #N is not a valid regex) and never prints the pattern. Still fail-closed; nothing is loosened.

Scope

  • scripts/privacy-denylist.sh: engine-matched validation (allowlist patterns stay on GNU grep, which applies them).
  • scripts/test-privacy-denylist.sh: 4 regression cases (RED before: exit 2 but opaque message; GREEN after).
  • CHANGELOG.md.

This PR does NOT include

  • Any change to what the guard matches, or to the secret.
  • Support for PCRE syntax. Patterns must be POSIX ERE (for example drop (?i): the scan is already case-insensitive).

Test plan

  • bash scripts/test-privacy-denylist.sh: 36 cases pass.
  • bash scripts/privacy-denylist.sh: clean on this tree.
  • This PR's own Privacy Guard run uses the real secret, so it reports which pattern index is invalid, if any.

GNU grep -E accepts PCRE syntax such as (?i), (?:...) and lookarounds that git grep -E rejects, so a secret pattern using it passed validation and then failed the scan as an opaque 'git grep failed'. Validate denylist patterns with git grep itself so the error names the pattern index and never prints the pattern. Allowlist patterns keep GNU grep validation because grep applies them.
@bntvllnt bntvllnt self-assigned this Oct 30, 2026
bntvllnt added a commit that referenced this pull request Oct 30, 2026
….8 (#25)

## Authorized sensitive baseline update
The repo owner asked for the stack pin to follow the skills
package-owner answers (vllnt/skills#28). Accept source
`7483dd4dfd8502fd2db376c13e44fa0cbc464161` through this separate
protected PR, as in #9 and #23, without changing the automatic
sensitivity policy.

- Pin moves from `352eaf7b167a6761161415711ef9d55db26d91d6` (1 skills
commit).
- Bump distribution `0.1.0-canary.7` to `0.1.0-canary.8`.
- Regenerate all three hosts with `scripts/sync.py`; no generated file
was edited by hand.
- Content: `@vllnt/convex-api-keys`, `@vllnt/logger`, `@vllnt/analytics`
defaults; `ui-core`/`ui-native` experimental opt-in; `dig` not yet
default.
- No updater, generator, workflow, permission or branch-protection
changes.

## Verification
- 38 unit tests pass; `sync.py --check` matches all 551 files both
offline and over the public network; `git diff --check` passes; gitleaks
over full history finds nothing.
- Only `upstream.lock.json`, `VERSION`, `CHANGELOG.md` and generated
`plugins/**` change.
- Privacy Guard is red on this PR for the same reason it is red on
`main`: the `PRIVACY_DENYLIST_EXTRA` secret has patterns `git grep -E`
rejects (see #24). It fails before scanning content.
@bntvllnt

Copy link
Copy Markdown
Contributor Author

Superseded by #26 (same fix: validate patterns with the scanning git grep engine), merged on main at 551694c. Closing without deleting the branch.

@bntvllnt bntvllnt closed this Oct 31, 2026
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