Repository navigation
feat(rules): leaked-secrets names Cerebras, OpenRouter, NVIDIA, Fireworks, Shopify Admin, Stripe restricted, Google OAuth secrets; sbp_ is a PAT #1309 - #1318
Closed
nc9 wants to merge 3 commits into
Conversation
nc9
force-pushed
the
feat/1309-secrets-new-patterns
branch
4 times, most recently
from
November 1, 2026 11:54
fcfbd50 to
ed20483
Compare
5 tasks done
nc9
force-pushed
the
feat/1309-secrets-new-patterns
branch
from
November 1, 2026 13:16
ed20483 to
0e2cfd6
Compare
4 tasks
nc9
force-pushed
the
feat/1309-secrets-new-patterns
branch
from
November 1, 2026 15:00
0e2cfd6 to
2e1c5ff
Compare
nc9
force-pushed
the
feat/1309-secrets-new-patterns
branch
3 times, most recently
from
November 1, 2026 18:47
a6a34aa to
25049d7
Compare
…rs, docs passwords, base64 A runs, asset names; labels Paystack keys #1283 #1227 Signed-off-by: Nik Cubrilovic <[email protected]>
…con JWTs, presigned ids; search keys and consent issuers stay reported #1287 #1229 Signed-off-by: Nik Cubrilovic <[email protected]>
…orks, Shopify Admin, Stripe restricted and Google OAuth secrets; sbp_ is a personal access token; Hygraph JWTs #1309 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
feat/1309-secrets-new-patterns
branch
from
November 1, 2026 19:54
25049d7 to
d1ed5f3
Compare
Merged
Contributor
Author
|
Landed in v0.0.158 as nik |
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.
Fixes #1309
Depends on #1298 and #1300 (same file; this branch is a chain on top of them. Merge those first and this PR shows only its own diff).
Named patterns and labels for provider formats that had none or the wrong one. No allowlist and no downgrade: every new detection reports at its own tier, so the review rule (positive evidence for any downgrade) has nothing to bite on except false-positive risk, which the probes below cover.
What changes
sk-or-v1-+64 hex, Cerebrascsk-+40+ lowercase alnum, NVIDIAnvapi-+60+, Fireworksfw_+24-48 alnum (medium, tail must mix upper, lower and a digit sofw_config_nameis not a key), Stripe restrictedrk_live_, Shopify Adminshpat_/shpss_/shpca_/shppa_+32 hex, Google OAuth client secretGOCSPX-+28.sbp_+40 hex is relabelledSupabase Personal Access Token(it is a Management API token for the user's whole account, not aservice_rolekey). The labelSupabase Service Role Keyhad no other user in either repo.isshost ismanagement-*.hygraph.comisHygraph Management Token(high); another*.hygraph.com/graphcms.comhost isHygraph Content API Token(medium). Whole-host match on the parsed issuer.sk-pattern never sawcsk-: its prefix sits inside a word).Verification
leaked-secrets-providers.test.ts, one harness generator per pattern (the corpus meta-tests derive a positive per context, a prefilter assertion, a corrupted-keyword near-miss, a mid-token near-miss and a duplicate case from each). Suites pass by path (2440 + 244),tsgo --noEmit,make validate, detect-secrets hook clean. Codex pass not run (MCP unavailable).Probes (false-positive and bypass)
desk-<48>(prefix inside a word)sk-or-v1-in prose; 20-hex tailGOCSPX-+ 10 charsnvapi-+ 20 charsrk_live_+10;rk_test_+24fw_config_option_name_for_the_firewall,fw_+ 26 lowercase,fw_+ 30 uppercase+digitsmanagement-eu.hygraph.com.evil.test,nothygraph.comissuerssbp_service_roleJWT andsb_secret_keep their labelsfw_,nvapi-,shpat_,sk-or-v1-)my-fw_Aa1...(hyphen to the left of the prefix)_and-)Rebase 2026-11-01
Rebased on main (v0.0.156, 99f63d3) as part of the stack 1298 -> 1300 -> 1318 -> 1319 -> 1320; CHANGELOG bullets re-inserted under [Unreleased];
.secrets.baselineline numbers refreshed (no new entries). Draft: corpus A/B pending.Review round (stack rebased on v0.0.157)
fw_: a camelCase identifier with a digit (fw_handleResizeEvent2Callback) is no longer a key (two lowercase-word/Capital boundaries read as a name); a random key still reports at medium; the 24/48 bounds, the no-upper and no-digit lookaheads and the medium tier are pinned./files/shpat_<hash>.png, via the asset-name rule), a CSS class (.shpca_<hash>) and a longer word (x-shpat_<hash>) are not tokens; a realshpat_+ 32 hex in a string, assignment, header or Bearer reports high. All four prefixes tested, including a page that holds only ashppa_token.sbp_, GOCSPX- and Stripe restricted keys are critical in a browser-served script (and not in plain HTML); OpenRouter, Cerebras and NVIDIA stay high and Fireworks medium (rule-level check names asserted too). OpenRouter's lowercase-hex alphabet, thegraphcms.comHygraph host and look-alikes are tested.sk-or-v1-+65 hex,GOCSPX-+40,shpat_+64 hex andsbp_+64 report "Secret Key (provider unknown)" at medium: accepted as is.Skill change: none.