Repository navigation
Secret scan: a PAT on one line must not hide a literal token on another - #1068
Conversation
Codex on 6a3059a: detect_secrets/1 also receives whole files (via Rules.scan_file/3), and the previous de-duplication dropped "Token assignment" whenever ANY specific credential appeared anywhere in the content. A GitHub PAT on one line therefore hid a distinct literal DEPLOY_TOKEN on another. The generic label is now dropped only when every value it matched is itself named by a specific matcher -- the same secret twice. A test covers a PAT and a separate literal token in one file: both are reported. 685 tests pass. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
Red checks: none are from this diffThis PR changes
Codex's code review of this PR found nothing. Its security review could not run because the Codex account is out of credits. Detail in #1064. Generated by Claude Code |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|



What
Follow-up to #1065. It merged at
6a3059a, one commit before this fix, somaincurrently has the bug below.detect_secrets/1also receives whole files (viaRules.scan_file/3). Its de-duplication dropped the generic "Token assignment" label whenever any specific credential (a GitHub PAT, an npm token, …) appeared anywhere in the content. So a file with a PAT on one line and a separate literalDEPLOY_TOKEN=…on another reported only the PAT. Fixing that one finding left the second leaked credential undetected.The generic label is now dropped only when every value it matched is itself named by a specific matcher — that is, the same secret reported twice.
Codex found this on #1065 (the per-value comparison it asked for).
Testing
New test: one file holding a GitHub PAT and a distinct literal
DEPLOY_TOKEN. Both are reported.secret_pattern_gaps_test,scanner_suppression_testandcli_test: 112 tests, 0 failures (local Elixir 1.17 / OTP 25 harness).Generated by Claude Code