Skip to content

Tech detection reads at most 256 KB per bundle (plus 24 KB samples), 5 s per page, 8 candidates: large app bundles hide technologies #1387

Closed

Description

@nc9

What happens

Tech detection reads only part of a large first-party bundle, so it misses technologies whose fingerprints sit deeper in. Modern Vite and Next.js builds are routinely 500 KB to 2 MB. Limits on the path, all at v0.0.146:

Limit Where Value
TECH_SCRIPT_CONTENT_LIMIT (hard ceiling per script, whatever the config says) packages/tech-detect/src/detect.ts 256 KB
[tech_detect] bundle_bytes default SERVICE_LIMITS.techDetectBundleBytes 64 KB
Per page / per audit body budgets techDetectPageScriptBytes / techDetectAuditScriptBytes 512 KB / 1 MB
Extras sampled past the head TECH_BUNDLE_EXTRAS_BYTES 24 KB per bundle
Wall-clock budget per page TECH_DETECT_PAGE_BUDGET_MS 5 s (detection silently stops)
Candidates an inCode detector inspects MAX_IN_CODE_CANDIDATES 8

Evidence: we re-ran detection offline over stored crawls from a batch audit. The engine was identical except that these limits were raised (8 MB per script, 60 s per page, 64 candidates). It found React on 30 sites instead of 26 in a 57-site sample (+15%), plus Sentry. In the same batch, three Supabase apps were missed because the project URL was past the sampled windows (#1379 fixed the sampling for Supabase specifically, but the ceiling still applies to every other fingerprint).

These limits trade CPU and cloud payload size for coverage. The bytes are already in memory: the crawl fetched the bundles, and with store_scripts they're on disk too.

Expected

Local tech detection reads every fetched first-party bundle whole up to a generous cap (for example 8 MB per bundle), with a time budget sized for that, and it reports when a cap or budget cut detection short instead of stopping silently. The cloud payload can stay capped if the local scan does the full read and sends its result.

Acceptance Criteria

  • A fingerprint placed 1.5 MB into a 2 MB first-party bundle is detected by squirrel audit with default config.
  • [tech_detect] bundle_bytes can raise the per-script read to at least 8 MB; no hard-coded constant below the configured value cuts it.
  • When detection stops early because of a byte cap or the time budget, the report's technologies section says so (for example truncated: true with the reason) instead of silently returning fewer items.
  • Detection time on a 5 MB adversarial bundle stays within the per-page budget (existing perf test extended).
  • Docs for [tech_detect] list the limits and defaults.

Activity

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

    @nc9
    ContributorAuthor

    Correction: the Sentry figures below used the old /Sentry\.init/ pattern and are inflated by supabase-js prose. Corrected whole-corpus numbers are in a later comment.

    Numbers from the offline corpus re-run (10,191 single-launch sites so far, identical stored inputs per site; v0.0.146 tech code against the same code with an 8 MB bundle cap, 60 s page budget and 64 in-code candidates):

    Technology v0.0.146 uncapped ratio
    Sentry 158 679 4.3x
    PostHog 349 774 2.2x
    Stripe 117 172 1.5x
    React 4,977 5,208 +5%
    Supabase 742 763 +3%

    Sites the uncapped run loses against v0.0.140 are single digits per technology (Contentful 4, Clarity 4, three.js 2, then 1s). Worth a look before the cap goes up: they may be candidate ordering with 64 slots.

    Separate regression found in the same run: #1420 (v0.0.146 hint windows crowd out the sample tail, so 30 sites lose Sentry).

    nik

  4. nc9 commented on Oct 31, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.147 (837ec610), verified against main: every acceptance criterion is met. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.147

    nik

  5. nc9 commented on Oct 31, 2026

    @nc9
    ContributorAuthor

    Correction to my numbers above, now on the whole corpus (34,968 single-launch sites, identical stored inputs per site).

    The "uncapped" column above used v0.0.146's Sentry pattern /Sentry\.init/. Reading whole bundles, that pattern matches a string inside supabase-js that mentions Sentry.init(), so the Sentry jump was mostly false positives (#1420 has the details). v0.0.147 has the tighter pattern from this issue. Comparing v0.0.146 at the corpus caps with v0.0.147 using the local scan's options (whole bundles up to 8 MB, LOCAL_TECH_DETECT_OPTIONS):

    Technology v0.0.146 (256 KB caps) v0.0.147 local scan ratio
    Sentry 497 1,184 2.4x
    PostHog 943 2,277 2.4x
    Stripe 469 667 1.4x
    React 17,083 17,800 +4%
    Supabase 2,799 2,874 +3%
    • Sentry under the old pattern with whole bundles was 2,061, so the pattern change removed about 880 false positives.
    • PostHog gains were spot-checked: each sampled site bundles posthog-js itself.
    • Apart from Sentry, v0.0.147's local scan gives exactly the same results as the research build above, so the 8 MB cap behaves as intended.

    The small losses I flagged (Clarity, Contentful) are not candidate ordering. script-url detectors stop scanning a page's HTML once the page has script bodies attached, which hides inline loader snippets: #1430. Clarity 1,311 to 1,286, Contentful 390 to 380.

    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

    performancesize: M

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions