Repository navigation
fix(gitleaks): anchor the installation-token rule on a word boundary - #928
Conversation
The github-app-installation-token regex had no leading boundary, so words ending in "ghs" with a long snake_case tail (highs_and_lows_..., laughs_out_...) matched. claude-code-plugins' test fixtures carry exactly those words to prove the guardrails ignore them, and since the 19:15Z sync its main gitleaks scan fails on them. A leading \b keeps both real token formats matching. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KeBVgcit2kegjiQYpvp8ji
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-review reviewed No findings. I read the 2-file diff and the PR context, and looked for other copies of the regex. The only occurrence outside the diff and PR context is
|
|
claude-security-review reviewed No security findings in PR #928 at head b837c7b. The PR adds a leading
|
No related issue: main-red fix for a downstream consumer; claude-code-plugins main has failed its gitleaks scan since the 19:15Z standards sync.
Summary
The
github-app-installation-tokenrule matched words that end in "ghs" followed by a long snake_case tail. claude-code-plugins' test fixtures containhighs_and_lows_of_the_market_over_the_yearandlaughs_out_loud_at_the_whole_long_meeting_todayto prove its guardrails ignore them. Since sync #11340 brought this rule over, every mainpr-require-checksrun there has failedlint-repoon gitleaks (first red: run 41115660342 at 19:29Z).Fix
Anchor the regex on a leading word boundary:
\bghs_[A-Za-z0-9._-]{36,}. Both real formats still match: a classic token and a statelessghs_<appid>_<jwt>token, where the prefix follows=, a quote or whitespace.Verification
components/gitleaks/gitleaks.test.shgains a stay-quiet case. It fails against the old config ([20] ... exit expected 0 got 1) and the full suite passes with the fix (25/25).gitleaks git --log-opts=--allover claude-code-plugins with the fixed rule gives 0 hits for this rule (6 before). A sample holding both real token shapes still gives 2 hits.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01KeBVgcit2kegjiQYpvp8ji