Repository navigation
Description
Pulled the latest cloud report for each of 776 audited sites (last 120 days) and aggregated the security/leaked-secrets checks. Counts are sites, not findings unless stated.
| tier | sites | top patterns (findings / sites) |
|---|---|---|
| high (fail) | 6 | Telegram Bot Token 50/1, Resend 2/2, Bitbucket 1/1, Neon 1/1, Google AIza reported as "Firebase" by an old build 1/1 |
| medium (warn) | 185 | Sanity Token 346/74, LinkedIn Client Secret 187/44, Generic Secret Assignment 116/40, Cloudflare API Token 85/27, Segment 39/5, Generic Token Assignment 29/16, Heroku 15/4, Generic API Key 15/13, Bearer 9/5 |
| public (info) | 118 | Google browser key 75/68, PayPal Client ID 66/15, Supabase anon 29/17, Stripe pk_live 19/19 |
Verified against the live pages, every high-tier hit is a false positive:
- Telegram
[0-9]{8,10}:[\w-]{35}matched the tail of a Webflow interaction id:…a0d694967460:785cabcc-e500-e2f4-e9f0-06a5104d3f11. No boundary before the digits. - Resend
re_[a-zA-Z0-9]{32,}matched inside an image filename…_Care_DryCrackedSkinReliefHydratingBalm_ATF…. No boundary beforere_. - Google
AIzais a Maps browser key (public tier in current code, reported as high by an older build).
The medium tier is dominated by context patterns keyed on ordinary words: sanity is not even a keyword (the pattern is a bare sk[a-zA-Z0-9]{30,}, which matches minified identifiers and base64), and linkedin, cloudflare, together, segment, heroku, mistral, datadog appear in prose or script URLs on most sites, after which any 16/32/40/64-char hash or UUID nearby is reported. Cloudflare API Token fires on SRI sha512- hashes and challenge nonces on every Cloudflare-fronted site. PayPal Client ID ([Aa][Zz]…{60,}) fires on Italian and Indonesian slugs starting with az.
Net: with 776 real sites the scanner produced zero confirmed leaks and roughly 1,100 false findings. A 100-site write-up on the current detector would be all noise.
What the reference tools do differently (trufflehog, gitleaks):
- every prefix pattern is bounded (
\bor a preceding-char class), and keyword prefilters use provider-unique tokens (AKIA,sk_live,hooks.slack.com), never English words; - generic patterns carry an entropy floor (gitleaks: 3.5 for generic-api-key) and a stopword/placeholder allowlist;
- an unverified generic hit is reported at a lower tier than a provider-specific one, and multi-detector overlap on one value suppresses it.
Acceptance Criteria
- Every prefix-anchored pattern rejects a match whose preceding character is
[A-Za-z0-9_](Telegram inside a UUID pair and Resend inside_Care_Dry…no longer fire) - Context patterns keyed on
linkedin,cloudflare,together,segment,heroku,mistral,datadog,sanityno longer report a value that is an SRI hash, UUID, hex digest, or a substring of a URL -
Sanity Tokenrequires the Sanity-specific shape or asanitykeyword within the context window -
PayPal Client IDno longer matches words inside URL slugs (requires a value position, not prose or path) - Generic assignment patterns skip values containing spaces or fewer than 3.5 bits/char Shannon entropy
- Re-running the 776-site corpus (private) reports fewer than 10 medium-tier sites and every remaining high-tier hit is a real credential shape
- The leaked-secrets unit corpus (test/leaked-secrets-harness) passes with the knownGap negatives promoted to hard negatives
Activity
nc9 commentedon Sep 16, 2026
Corpus harness is up in #358 (1015 pass / 45 todo, bench baseline 14.2 ms/MB, peak RSS 383 MB on a 66.7 MB synthetic corpus). Building it surfaced 14 more defects beyond the six above, all encoded as
knownGapcases:/a{16,}/ifalse-positive filter drops the 19 leading As.FALSE_POSITIVE_PATTERNSare unanchored substring tests: any real token containingxxx,fake,sampleordummyanywhere is dropped.sk…{30,}also fires inside base64 data URIs and CSS class soup.Authorization: Bearer <dotted>yields a duplicate medium "Bearer Token" beside the JWT/Discord finding; a Supabase anon JWT in a Bearer header gets a false medium warning.DO[A-Z0-9]{20,}runs before New Relic and claims the tail of any NRAL key containingDO.9-11.
looksLikeCodeIdentifierdrops about 30% of random keyed values: lowercase-then-uppercase opening,on/is/getprefixes,_with lowercase (real Cloudflare tokens contain_).sbp_shape labelled "Service Role Key" is a personal access token.pk_test_pattern; underapiKey:the generic assignment warns on a public Stripe test key.railway_…matches a shape Railway does not issue.Suggested order: 2, 1 and 12 are one-liners with large effect; 6 and 7 are pattern reordering; 3 needs a value-position gate or removal of the bare pattern.
nc9 commentedon Sep 16, 2026
Refinement from encoding the real-world negatives in #358 (33 known gaps now, 1038 pass / 64 todo): the "ordinary word" context family is narrower than stated above. With the keyword only in prose and a hash in an unrelated attribute, together/segment/mistral/datadog are already silent: the key-context gate holds. They fire when the page also has a minified member assignment (
w.s="<16 hex>"from the Shopify wpm bootstrap,e.k="<40>"from the Cloudflare challenge bootstrap) or a keyword-named attribute (data-heroku-dyno). SRIintegrityanddata-cfemailare correctly suppressed. So the fix is inclassifyKeyName/ the single-letter minified key acceptance, not in the keyword list. The boundary family (Telegram in a UUID pair, Resend and Neon in filenames and slugs,fooghp_/xsk_live_/abcAKIAmid-token) all fire HIGH today and is the first fix. Shopify storefront tokens and web-pixel Api-Key are tagged as a scoping question rather than a must-not-fire.fix(rules): leaked-secrets round 2: percent-escape boundary, JWT-owne…
fix(rules): leaked-secrets: a naming attribute of the same tag counts…
fix(rules): leaked-secrets round 3: Shopify boot JSON, PostHog phc_, …
fix(rules): leaked-secrets: inline scripts carry their open tag, dedu…
fix(rules): leaked-secrets: a host test for cdn.shopify.com, no regex…
fix(rules): leaked-secrets: decide the Shopify page by parsed hostnam…
fix(rules): leaked-secrets precision and test habits (#357, #363) (#366)