Skip to content

security/leaked-secrets: detector parity with trufflehog for browser-exposed services #359

Description

@nc9

trufflehog ships 886 detectors. Comparing the browser-relevant subset against our 88 patterns leaves roughly 35 services with distinctive, client-side-exposed shapes that we do not recognise. Add them as FAST (prefix) patterns where the provider uses a unique prefix, and as CONTEXT patterns with a bounded look-behind (keyword, at most 40 chars, word-bounded value) otherwise. Never a bare shape keyed on an English word.

Groups, in priority order:

  • analytics and product: PostHog phc_, Intercom, LaunchDarkly (sdk-/mob- UUID), Amplitude as a real pattern, New Relic browser key NRJS-
  • commerce and CMS: Shopify shpat_/shpss_/shpca_/shppa_, Storyblok, Contentful CDA/CMA, Webflow, Squarespace, Airtable pat…, Notion secret_/ntn_
  • media and messaging: Cloudinary cloudinary://, Mux, OneSignal, Pusher, PubNub pub-c-/sub-c-, Zapier webhook URL
  • cloud: GCP service-account JSON ("type": "service_account" + private_key_id), Cloudflare global API key (37 hex + email), Azure SAS (sig= + se=) and function keys, Sentry org token sntrys_, Supabase management token sbp_ relabelled correctly
  • forms and scheduling: Typeform tfp_, Calendly, Uploadcare, Unsplash

Public-by-design tiers to add alongside: Stripe pk_test_, PostHog project key, Pusher app key, PubNub subscribe key, Algolia search-only key (distinct from admin), LaunchDarkly client-side id.

Test suite: one seeded generator per new pattern in tests/security/leaked-secrets/generators.ts, one near-miss negative (single corrupted character or wrong prefix) per pattern, and a prefilter assertion once the keyword prefilter lands (#363).

Acceptance Criteria

  • Every service listed above has a pattern with at least one positive in two contexts and one near-miss negative in the corpus harness
  • No new pattern is keyed on a dictionary word; every CONTEXT pattern requires the keyword within 40 characters before a word-bounded value
  • The public-tier keys listed report as leaked-secrets-public, never high or medium
  • Re-running the private 776-site corpus adds no more than 5 new medium-tier sites
  • The rule doc page and the skill README pattern count match the code

Activity

  1. added
    enhancement
    on Sep 16, 2026
  2. added
    security
    rules
    P3
    size: L
    on Sep 23, 2026
  3. nc9 commented on Oct 11, 2026

    @nc9
    ContributorAuthor

    Checked against current main (ad95fb2): mostly STILL TRUE. packages/rules/src/security/leaked-secrets.ts now has 103 named patterns. Some services on the list are covered:

    • PostHog phc_ (line 618, public tier), Amplitude (814), Contentful (852), Intercom app id and LaunchDarkly client id (2105, 2109), Supabase sbp_ (204), Algolia and Stripe pk_test_ (public).

    Not found in the source: Shopify shpat_/shpss_/shpca_/shppa_, New Relic NRJS-, Typeform tfp_, PubNub pub-c-/sub-c-, Cloudinary cloudinary://, Notion ntn_, the GCP service-account JSON shape, Zapier hook URLs, the Azure SAS sig= + se= pair, Storyblok, Webflow, Airtable, Mux, OneSignal, Pusher, Calendly, Uploadcare and Unsplash. Sentry sntrys_ appears only in a comment (line 2334), not as a pattern.

  4. added theissue type on Oct 28, 2026
  5. added
    in-progress
    on Nov 24, 2026
  6. self-assigned this
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P3enhancementin-progressrulessecuritysize: L

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions