Repository navigation
Secrets check reads files whose names hold a space or an accent (GST-3528) - #4701
Merged
Merged
Conversation
…aders (failing first) A Rust key in src/clé.rs or src/my file.rs passes pregate on main, and the pre-push hook names the first an unknown file and drops the second. Refs GST-3528 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
pregate and the pre-push hook took a file's name from a raw +++ b/ header, so a name git C-quotes (non-ASCII, quote, backslash, control character) became no file and a name holding a space kept git's trailing tab. Either way the scanner got no file type and every path-scoped rule skipped it. diffHeaderPath decodes the header the way git writes it, and all four parsers use it. Refs GST-3528 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Now that the secrets check decodes git-quoted names, a name holding ESC or a newline would reach the terminal raw and could rewrite the line that names the file. Both report lines print such a name JSON-quoted. Review-Finding: p1b/red-team#1 reader=red-team Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… long ones A name git quotes or tab-ends is now scanned both ways: under its decoded name and the way main read it (added.txt in the secrets check, no path in the push check), so it never reports less than before. A decoded basename too long to write is scanned as added plus its extension instead of stopping the check. Allowlist and scanner-error lines print names through displayPath, which now also escapes C1 and bidi-override characters. Review-Finding: p2v/outside-voice#2 reader=outside-voice Review-Finding: p2v/outside-voice#3 reader=outside-voice Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Merged
3 tasks done
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.
The secrets check now reads a file whose name holds a space, an accent, a quote or a backslash, such as
src/clé.rsorsrc/my file.rs.Why: git writes those names quoted or with a trailing tab, so the file reached the scanner with no type and a key in it passed; the push check also listed it as an unknown file.
Nothing to do.
What changed
diffHeaderPathin lib/pregate/checks/secrets.ts reads a+++header the way git writes it: a C-quoted name ("b/src/cl\303\251.rs", octal UTF-8 bytes and\t-style escapes) is unquoted, and the tab git adds after an unquoted name holding a space is dropped.addedplus its extension instead of stopping the check.Tests and replay
src/clé.rsorsrc/my file.rspassed the secrets check, and the push check named the first(unknown file)and dropped the second. The parser unit test read both names wrong..tsname still reports at least what main reported.Agent notes
Thread GSTA-800 for GST-3528, found by the second-model review on #4697. lib/pregate/index.ts is not touched. Other
+++parsers with the same raw read, left out of scope: lib/banned-terms.ts, lib/no-stop.ts, lib/sealed-guard.ts, bin/gstack-brain-secret-scan.py (lib/gate-diff/git.ts already drops the tab).Approvals
Approved: yes (record r-b892276d528e). The full approval record stays private.
Plan: exempt: bug fix with failing-first tests (R4)
Plan check: exempt bug fix
Ruled note: lib/pregate/checks/secrets.ts:222:outside-voice at 51b4ade ruled by GSTA-36 (relayed from GSTA-800:01M81RHGYNFEZ2M7QFY416WBRR) at 2026-11-22T13:54:08.335Z: contrived backslash file name; the allowlist matcher's backslash handling predates this PR (approval a-ba36c6b64041)
REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=8 fixed=3 scope=frozen open=1 ledgers_read=5 fix_checks=1 dispatches=4