Repository navigation
feat(tech-detect): read first-party script bundles, run detection locally from the same bytes #1254 - #1256
Merged
Conversation
…ally from the same bytes #1254 Signed-off-by: Nik Cubrilovic <[email protected]>
…ed call sites, per-script floor #1254 Signed-off-by: Nik Cubrilovic <[email protected]>
…e scope and privacy #1254 Signed-off-by: Nik Cubrilovic <[email protected]>
…est_/pk_live_, strict [tech_detect] #1254 Signed-off-by: Nik Cubrilovic <[email protected]>
nc9
marked this pull request as ready for review
October 29, 2026 03:57
|
Review of #1256 (tech detection reads first-party script bundles). I read
The shared builder for the local and cloud paths is a good design. The changelog and docs are thorough. The new |
This was referenced Oct 29, 2026
nc9
added a commit
that referenced
this pull request
Oct 29, 2026
… the change history (#1264) Refs #1263 The guides said technology detection needs an account and credits. A signed-out or `--offline` audit already scans the stack from the crawled pages, headers and first-party JS bundles (#407, #1256); the cloud adds the change history. Fixed in local-audits-cli, audit-levels, cloud-audits, docs index, cloud index and cloud/technologies. Wording follows cloud/technologies.mdx. Docs only; no CHANGELOG bullet (matches earlier docs-only PRs). The squirrelscan agent skill needs no change.
This was referenced Oct 29, 2026
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.
Closes #1254
What
assets.scripts). No refetch, no extra request.[tech_detect] bundle_bytes, 0 to 262144, 0 = off), 512 KB per page, 1 MB per audit. A bundle body is attached to the first page that references it; later pages list its URL only.inCodeflag onscript-contentdetectors (packages/tech-detect/src/js-scan.ts): the match must start in code, not inside a comment or string literal. Used for Supabase (createClienton a 20-char*.supabase.coref), Firebase (authDomain,storageBucketconfig) and Clerk (publishableKey). Placeholder, short-ref, look-alike-host, comment, docs-string and HTML-only cases are negative tests.detectTechnologiesslices every script body to 64 KB and takes a per-page time budget (default 5 s,onBudgetExceeded), on top of the fix(tech-detect): bound unbounded fingerprint patterns (requirejs 70 s on hostile page) #1244 #1245 bounded patterns. A 1 MB hostile bundle test asserts it finishes inside the budget.buildTechInputsin audit-engine,buildTechPageInputsin the CLI) feeds both the local scan and the cloud payload, so a signed-in and a signed-out audit read the same bytes. Previously the local scan passed non-home pagesscripts: []while the cloud sent none; both now fall back to HTML script-URL scanning for a page with no attached body.--offlineend-to-end test showstechnologieswith Supabase from a bundle-only SPA.Tests
packages/tech-detect/tests/bundle-content-1254.test.ts: Vite SPA, Next.js chunks (Firebase + Clerk), near-miss negatives, 64 KB cut, hostile 1 MB, budget.packages/audit-engine/tests/tech-bundle-inputs-1254.test.ts: per-bundle, per-page, per-audit caps, once-per-audit attach, UTF-8 byte cut.apps/cli/tests/audit/tech-detect-bundles-1254.test.ts: realsquirrel audit --offlineagainst a fixture server; request counts are identical with bundle matching on and off (bundle_bytes = 0).apps/cli/tests/audit/tech-detect-cloud-local-parity-1254.test.ts: cloud payload and local scan detect the same set.tsgo --noEmitclean for tech-detect, audit-engine, config, cli; CLIlintandformat:checkclean;scripts/test-suites.ts --checkok;make validatein docs ok; detect-secrets clean.Private repo (cloud worker-agent / api)
Cloud payload shape (
TechDetectPagePayload) is unchanged, but scripts now carry up to 64 KB bodies (was 16 KB, home page only), on non-home pages too, up to 1 MB per audit. The server must accept that (any per-script or per-page content cap and body limit) and run the same@squirrelscan/tech-detectbuild.detectTechnologiesnow also cuts bodies to 64 KB itself. If worker-agent builds its own tech inputs for cloud-run audits, it should callbuildTechInputs.Skill
The squirrelscan agent skill (
squirrelscan/skills) needs no change.