Skip to content

Tech detection misses Supabase in real bundles: URL in a variable, sb_secret_ keys, matches past the bundle byte budget #1379

Closed

Description

@nc9

What happens

Tech detection misses Supabase in real production bundles. In a batch of ~35k audits (v0.0.141, local tech-detect over first-party bundles, #1254), tech detection missed Supabase on 3 of the 5 sites where we had independently confirmed a leaked Supabase key in the bundle. Every one of them calls Supabase from the browser. Each miss has a different cause:

  1. The URL is a variable and the key literal sits elsewhere (Next.js/Turbopack chunk): let l="https://<ref>.supabase.co",h=.... No pattern matches, because the bundle detectors need the URL quoted right next to a key, a supabaseUrl/SUPABASE_URL property, or a createClient( call.
  2. The key is a new-format secret key: const pD="https://<ref>.supabase.co",gD="sb_secret_…",Cf=hD(pD,gD). The pair pattern accepts only eyJ… and sb_publishable_… keys, so sb_secret_ (the worst case to miss) never matches.
  3. A 742 KB Vite bundle: the pair pattern matches the full file at about 209 KB in, but the site was still not reported, probably because of the bundle byte budget ([tech_detect] bundle_bytes, 256 KB in that run).

Every one of these bundles contains supabase-js's own strings, which no other library ships. Two examples: the Node.js deprecation notice that links to github.com/orgs/supabase/discussions/<n>, and the auth storage key template `sb-${…}-auth-token`.

Expected

A bundle that includes supabase-js and a quoted https://<20-char ref>.supabase.co project URL is detected as Supabase, wherever the key is and whatever its format.

Acceptance Criteria

  • A minified bundle containing the supabase-js deprecation notice (github.com/orgs/supabase/discussions/…) and let l="https://abcdefghijklmnopqrst.supabase.co" (URL in a variable, no key next to it) is detected as Supabase.
  • "https://abcdefghijklmnopqrst.supabase.co",gD="sb_secret_…" is detected as Supabase, the same as sb_publishable_ and eyJ keys.
  • A supabase.co project URL in a bundle well past the first 256 KB (e.g. at 400 KB in a 1 MB bundle) is still detected under the default bundle_bytes.
  • Not detected: a bundle with only a docs link or a your-project.supabase.co placeholder, a bundle with only the supabase-js strings and no project URL, and a Base44 app (the unlessAny rule still holds).
  • Tests use minified real-build shapes (see tech-bundle-real-build-1254.test.ts) for each case above.

Activity

  1. added
    size: S
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. nc9 commented on Oct 31, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.146 (114cafcd 396c8b93 a244399d c76ca88f), verified against main: every acceptance criterion is met, with tests on a real minified supabase-js build. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.146

    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

    size: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions