Skip to content

security/leaked-secrets: Cerebras keys missed, sbp_ mislabelled as service role (it's a personal access token), no patterns for OpenRouter/Google client secret/Shopify Admin/Stripe restricted keys #1309

Closed

Description

@nc9

Two labelling and coverage gaps in security/leaked-secrets, found while hand-verifying a ~38k-site batch (v0.0.141, masked context only, no credential used or tested), plus provider formats the rule has no named pattern for.

Missed and mislabelled

  • Cerebras keys are not reported. One page shipped an inline keys:[…] list with 3 Groq keys and 3 Cerebras keys (csk-…). All 3 Groq keys were reported; none of the Cerebras keys were.
  • sbp_ is labelled "Supabase Service Role Key". sbp_ + 40 hex is a Supabase personal access token (Management API, scoped to the user's whole account), not a project service_role key. Service-role keys are JWTs with role: service_role or the newer sb_secret_ keys. The label sends triage to the wrong remediation (rotate the project key vs revoke the user's token).
  • A Hygraph-issued token (JWT from management-*.hygraph.com) shipped as a client GraphQL bearer was reported only as a generic JSON Web Token, with no hint that it is a CMS content or management token.

Formats with no named pattern

Checked against packages/rules/src/security/leaked-secrets.ts on main. No corpus hits for these, so this half is pattern coverage, not observed misses:

provider format
OpenRouter sk-or-v1- + 64 hex (the OpenAI sk- patterns don't match it)
Google OAuth client secret GOCSPX- + 28 chars
Shopify Admin API shpat_, shpss_, shpca_ + 32 hex
Stripe restricted key rk_live_
Fireworks AI fw_ prefix
NVIDIA API nvapi- prefix
Paystack secret sk_live_ + 40 hex (today labelled Stripe; see #1283)

Acceptance Criteria

  • A Cerebras csk- key is reported with its own label, including when it sits in an array next to keys from another provider (fixture).
  • sbp_ keys are labelled "Supabase Personal Access Token" at high/critical confidence; a service_role JWT and an sb_secret_ key keep their own labels (fixtures).
  • A JWT whose iss is a Hygraph management host is labelled as a Hygraph token (fixture).
  • Each format in the table has a named pattern with a positive fixture and a near-miss negative (e.g. sk-or-v1- in prose without a key body).
  • The rule docs list the new providers.

Activity

  1. added
    size: M
    rules
    security
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. nc9 commented on Nov 1, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.158 and checked against it: every acceptance criterion is met. Cerebras, OpenRouter, NVIDIA, Fireworks, Shopify Admin, Stripe restricted and Google OAuth secrets are named with near-miss negatives, sbp_ is a Supabase personal access token, Hygraph JWTs are labelled by host, and the docs list the providers. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.158

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    rulessecuritysize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions