Repository navigation
fix(publish-gate): fold more obfuscations and catch UTF-8 look-alikes in the leak scan - #11570
Conversation
Lane-Activity: work-resolve-issue/resolve-issue
Lane-Activity: pr-unblock/address-feedback Lane-Thread: PRRT_kwDOTCGFQM6yQvxk
Lane-Activity: pr-unblock/fix-ci
…-publish-gate-utf8-pass
scanLeak read bytes as latin1 only, so NFKC and the invisible strip never saw a real zero-width space or fullwidth letter, and a credential hidden that way passed the lanes' leak scan. Add a UTF-8 pass for credential formats; latin1 stays for the byte patterns and the warn-only assignment. The pass uses firstHit over the blocking patterns rather than findSecret, whose first hit can be a plain assignment on an earlier line. Refs: #8811 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgcHpe4YpFuL5b24Ft2
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgcHpe4YpFuL5b24Ft2
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgcHpe4YpFuL5b24Ft2
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed No security issues found in this change. Scope read: the whole diff (6 files). That is What
Residual gaps (already stated in the PR body, out of scope per the linked issue): base64, hex and reversed encodings, the line-break fold (#8806), and a hidden plain assignment (not a credential format) in the UTF-8 pass. These are existing limits, not regressions from this diff. Spend: the leak scan takes slightly longer (about 15.4 s to about 17.1 s over the whole tree per the PR body). That is CI time only, with no billing change, so there is no cost hold. critical-findings: 0 |
|
claude-review reviewed Code review: no findingsI read the full diff ( Trusted path: Closing issue #8811, checked against its done-when list:
Residual gaps, all stated in the PR body or changelog (not findings):
Spend: none. No paid or billed resource and no lane-run settings change. |
Closes #8811
Replaces #11533, whose fix lane could not close its open review thread: the gap changes the shared leak scan and the lane runs no code. This PR carries #11533's commits, merged with main, plus the UTF-8 pass that thread asked for. #11533 is held with
do-not-merge.Summary
normalize()inlib/publish-gate.mjsnow repeats, per line, NFKC, stripping of zero-width characters (U+200B-U+200D, U+2060, U+FEFF) and the soft hyphen,\uXXXXdecoding, tag removal and entity decoding until a pass changes nothing, then drops a single backslash before ASCII punctuation. A backslash before/,.,"or'stays: folding those turns tracked regex sources and escaped JSON into paths, hostnames and assignments.New here:
scanLeakreads bytes as latin1, so NFKC and the invisible strip never saw a real zero-width space or fullwidth letter in the lanes' leak scan. It now also decodes the bytes as UTF-8 and runs the blocking credential patterns over that text withnormalize(). Latin1 stays for the byte patterns, the warn-only assignment, and the UTF-16LE and split-line passes, so non-ASCII text beside a plain assignment still only warns.Not verified
scanLeakwas only called directly, in the suites and the tree comparison below.Fix
lib/publish-gate.mjs: thenormalize()folds, exportednormalizeandfirstHit(with an optional fold), andfolds()counting\uXXXXand backslash escapes, from fix(publish-gate): fold more obfuscations in normalize() #11533. New: the UTF-8 pass inscanLeak. It callsfirstHitover the blocking patterns rather thanfindSecret, whose first hit can be a plain assignment on an earlier line, and it skips bytes whose UTF-8 and latin1 readings match.lib/publish-gate.test.mjs: one case per fold and the tracked-tree test from fix(publish-gate): fold more obfuscations in normalize() #11533. New: sevenscanLeakcases on UTF-8 bytes (zero-width space, soft hyphen, fullwidth look-alike, a credential after a plain assignment, non-ASCII beside a plain assignment, plain non-ASCII text, invalid UTF-8 around a token).plugins/review/lib/publish-gate.mjs,plugins/visualization/lib/publish-gate.mjs: regenerated byscripts/sync-shared-copies.sh..changes/review/and.changes/visualization/fragments: one more sentence for the leak scan.Verification
lib/publish-gate.test.sh: 97 tests, 97 passed, 0 failed..github/actions/resolve-config/callers.test.mjs: 211 passed, 0 failed..github/scripts/apply-patch/apply-patch.test.mjs: 195 passed, 0 failed..github/scripts/work-resolve-issue/report-outcome.test.mjs: 347 passed, 0 failed.scripts/sync-shared-copies.sh --check: all 548 registered copies match.scripts/check-changelog-fragments.sh --check: all fragments valid.scanLeakover all 16,018 tracked regular files, fix(publish-gate): fold more obfuscations in normalize() #11533's head against this change: 0 results differ, so no file newly blocks or warns. Total scan time went from about 15.4 s to about 17.1 s.Related
#8811
#11533
#8806
🤖 Generated with Claude Code