Repository navigation
Conversation
… quoted project URL; accept sb_secret_ keys #1379 Signed-off-by: Nik Cubrilovic <[email protected]>
…CHANGELOG under Unreleased #1379 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
force-pushed
the
fix/supabase-bundle-detect-1379
branch
from
October 30, 2026 21:09
cd4a260 to
984a08a
Compare
…118.0 build, built at test time #1379 Signed-off-by: Nik Cubrilovic <[email protected]>
…an match a detector, dedupes repeats, drops ones that cannot #1379 Signed-off-by: Nik Cubrilovic <[email protected]>
This was referenced Oct 30, 2026
Merged
Contributor
Author
|
Landed in v0.0.146 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 #1379.
Tech detection missed Supabase in real bundles in three ways. All three are covered:
script-contentdetector option,also, makes a bundle match only when the same script body also matches a second pattern. Supabase uses it: a quoted<20-char ref>.supabase.coURL anywhere (in a variable, no key beside it) counts when the bundle carries supabase-js's own strings: the Node.js deprecation notice linkinggithub.com/orgs/supabase/discussions/<n>or thesb-${...}-auth-tokenstorage key. Both patterns are linear (no nested quantifiers), and(?!your)and the repeated-char guard still reject placeholders.sb_secret_keys are accepted by the existing URL-plus-key pair pattern, likesb_publishable_andeyJ..supabase.co",.supabase.co', the discussions link,-auth-token), so they are pulled into the sampled windows of a big bundle under the default 64 KBbundle_bytes. A hit inside a short string that opened before the window (the deprecation notice is a 230-char string) now keeps the whole string instead of being skipped. Sampling now tests each hint hit's window against the patterns of the detectors that use that hint and keeps it only if one matches, deduping identical windows: a placeholder URL, a non-key pair or a repeated literal can no longer use up the sample, so a hit that can match (the supported pair pattern, or the signature plus URL) is always kept (bounded by 512 scans per hint and the existing byte budget). Hints with no detector pattern keep the old cap of 48; the byte caps are unchanged. This is the root cause of the issue's 209 KB miss: earlier.supabase.comentions used up the 24 kept hits before the real URL. Pinned by tests with 200 identical and 60 distinct earlier placeholder URLs, and 300 earlier URL-and-non-key pairs, in the synthetic file and in the real-build file (the app module sits between two filler modules, not in the head or tail); 3 of them fail on the previous sampler.Notes:
alsoneedsinCode: true(enforced by the type), and its second pattern also matches inside strings and comments, so a docs bundle that quotes both the discussions link and a 20-char ref URL would match. CHANGELOG bullet is under Unreleased; it will conflict with #1381's at the same line (whoever merges second rebases).Tests (
packages/audit-engine/tests/tech-supabase-signature-1379.test.ts, 12): synthetic minified-shape fixtures, no real hosts or keys (key shapes assembled at run time). URL in a variable plus notice; storage-key signature; URL at 400 KB+ of a 1 MB bundle under default limits; notice and URL both far past the head;sb_secret_,sb_publishable_and JWT keys; negatives (library strings only, URL only, docs link and placeholders); Base44unlessAnystill holds. 5 of them fail on main. Existing tech-detect (221) and 1254 bundle tests pass. Gates: tsgo in tech-detect and audit-engine, oxlint,make validate.Docs:
docs/cloud/technologies.mdx. CHANGELOG under Unreleased / Fixed. Skill: no change needed.nik
Real-build tests:
tech-supabase-real-build-1379.test.ts(7) builds the real supabase-js (devDependency@supabase/supabase-js2.118.0 in audit-engine, so bun.lock moves) withBun.build --minifyat test time, around synthetic refs and keys: URL in a variable,sb_secret_pair, URL past 256 KB of a ~1 MB bundle, URL after 40 earlier placeholder URLs, and negatives (library with no URL, library with a placeholder). 4 fail on main. The >24-earlier-hits cap miss is pinned in the synthetic file (fails at the old cap).@supabase/supabase-js2.118.0 is a devDependency of the privatepackages/audit-engineonly (never imported by shipped code); the bun.lock change is that package and its 7 dependencies, nothing else. detect-secrets-hook is clean on bun.lock and the new files.