Skip to content

feat(tech-detect): local scan sees stylesheet URLs, 24 stack fingerprints and a local or cloud source marker - #1316

Closed
nc9 wants to merge 4 commits into
mainfrom
feat/local-tech-detection-1263
Closed

nc9 wants to merge 4 commits into
mainfrom
feat/local-tech-detection-1263

Conversation

@nc9

@nc9 nc9 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1263

Nik's split: local detection (free, logged out, the pages the crawl already fetched, no extra requests) and cloud detection (adds the per-domain history). The local scan already existed (detectLocalTechnologies; #1254 added bundle reading in v0.0.140); this PR reproduces the reporter's case, fixes the real gap it found, fills fingerprint gaps and documents the split.

Reproduction and cause

An end-to-end squirrel audit --http --offline -m 30 over a fixture site (WordPress + WooCommerce, Google Tag Manager, Cookiebot, a Cloudflare-served response) reported the CMS, tag manager, consent tool and CDN but not WooCommerce. Cause: with a script list (the home page always has one) a script-url detector reads only <script src> values and never the HTML, so a signal that lives in a stylesheet path (/wp-content/plugins/woocommerce/.../woocommerce.css) was invisible. Fix: the shared builder (buildTechInputs, used by the local scan and the cloud payload alike) now also lists the page's <link rel="stylesheet|preload|modulepreload" href> URLs beside its scripts (extractLinkAssetHrefs, at most 40 hrefs a page, URLs over 1000 chars skipped, so worst case ~40 KB a page in the cloud payload; platform asset paths such as /wp-content/plugins/, /wp-content/themes/, /sites/default/files/, /static/version/, /skin/frontend/, /cdn/shop/ are listed first, then the rest in document order; with a cap of their own, listed after the scripts so they never push a script out). The other causes of header-only results (page sample, script bodies only for first-party fetched JS, no rendering in --http, no fingerprint) are documented.

What changed

  • packages/audit-engine/src/technologies.ts: extractLinkAssetHrefs and its use in buildTechInputs.
  • 23 first-party fingerprints in packages/tech-detect/src/fingerprints/stack.ts, written from each product's own host, path, marker or header (no third-party catalog or signature file read or copied; noted in the file header): consent tools Borlabs Cookie, Complianz, Real Cookie Banner, Cookie Notice, consentmanager, Klaro, Axeptio, CookieFirst, Cookie Information, Cookie-Script; tag managers Cloudflare Zaraz, Matomo Tag Manager, Piwik PRO Tag Manager, Commanders Act; CMS and shop Lightspeed eCom, Contao, SilverStripe, Plone, Grav, Odoo, Liferay, Pimcore; CDN Azure Front Door. (Google Cloud CDN was dropped in review: the via: 1.1 google header is also sent by Cloud Run, App Engine and Cloud Functions.) Each needs real markup context (script tag, resource attribute, inline script, anchored meta, header); a post naming all of them and showing their snippets in <pre> matches none.
  • ReportTechnologies.source (local | cloud): set by the CLI, passed through the JSON report, and a local section shows "Detected locally from the crawled pages (no scan history)" instead of a "No changes since last scan" it cannot know (text, markdown and HTML reports). Absent on older reports and unchanged for them.
  • Docs: docs/cloud/technologies.mdx (new "Local and cloud scans" section with a comparison table and "Why a result can show little more than headers"; categories table; signature count 438) and docs/guides/local-audits-cli.mdx (the stale line was already corrected in feat(tech-detect): read first-party script bundles, run detection locally from the same bytes #1254 #1256; now links the split).
  • The detector helpers moved from other.ts to fingerprints/helpers.ts, byte-identical to the move in feat(tech-detect): Bolt and WordPress caching, SEO and image plugins and managed hosts #1303, so the two PRs merge cleanly on that file.
  • No rule added or removed, rule count unchanged.

New icon slugs (private repo needs PNGs in apps/web/public/tech-icons; none invented)

borlabs-cookie, complianz, real-cookie-banner, cookie-notice, consentmanager, klaro, axeptio, cookiefirst, cookie-information, cookie-script, cloudflare-zaraz, matomo-tag-manager, piwik-pro-tag-manager, commanders-act, lightspeed-ecom, contao, silverstripe, plone, grav, odoo, liferay, pimcore, azure-front-door (23 new; google-cloud-cdn dropped).

Notes for the private repo and merge order

Review round (c263f08)

  • CodeQL polynomial regex: the rel check now splits on whitespace and uses a Set lookup (also handles unquoted attributes).
  • llm and xml <technologies> now carry source= and omit first-scan/added/removed for a local section.
  • google-cloud-cdn dropped; link hrefs have their own cap of 20 appended after the 60-script slice; CHANGELOG bullet added.

Review round 2

Link cap 20 to 40 with platform paths first (test: 70 stylesheets, WooCommerce CSS last, still detected); glued rel=stylesheet/> handled; x-azure-ref comment says it is slightly broader than Front Door; CHANGELOG blank line and test comment fixed.

Evidence per fingerprint

Live-confirmed with curl on the product's own site: Contao (generator "Contao Open Source CMS" on contao.org), Plone (Plone 6 - https://plone.org on plone.org), Grav (generator "GravCMS" on getgrav.org), Odoo (generator "Odoo" on odoo.com); vendor script hosts answered for consentmanager, Axeptio, CookieFirst (403 to curl, host exists), Cookie Information (uc.js), Cookie-Script (301), Commanders Act (tagcommander), Lightspeed (webshopapp), Matomo cloud (404 on bare path).
Documentation-based, NOT verified live: x-azure-ref (Azure Front Door response header), liferay-portal header, pimcore marker, the ^1\.1 google$ removal rationale, and the remaining consent and tag-manager path or marker signals not listed above. Treat those as medium confidence until a live site is found.

Tests

  • apps/cli/tests/audit/tech-detect-local-stack-1263.test.ts: the end-to-end --http --offline -m 30 audit; reports WordPress, WooCommerce, Google Tag Manager, Cookiebot and Cloudflare, with source: "local" (WooCommerce failed before the fix).
  • packages/audit-engine/tests/tech-link-asset-urls-1263.test.ts, packages/tech-detect/tests/local-stack-fingerprints-1263.test.ts (each fingerprint detected, look-alikes and prose not), packages/report/tests/technologies-source-1263.test.ts.
  • Passing: those, the Tech detection: include first-party JS bundle contents, and run tech-detect locally when the cloud service isn't used #1254 parity and bundle tests, streamed-payload-parity, tech-detect suites and pattern-bounds, streaming-rules-canonical-golden, scripts/test-suites.ts --run rest (2118 pass) and --run report (1029 pass), cli format, lint and tsgo, tsgo on tech-detect, audit-engine, report and core-contracts, make validate in docs/.
  • Not run: the full cli and rules suites (CI), real-site smoke tests of the new fingerprints, a signed-in cloud audit. The signals are from my knowledge of each product, not checked against a live site per product; Google Cloud CDN is medium confidence. Local Bun is not the pinned 1.4.4.

Docs: docs/cloud/technologies.mdx, docs/guides/local-audits-cli.mdx. Skill: none.

@nc9 nc9 mentioned this pull request Oct 30, 2026
nc9 added 4 commits October 30, 2026 19:59
…ml, drop google-cloud-cdn, separate link cap #1263

Signed-off-by: Nik Cubrilovic <[email protected]>
…ders; e2e for header fingerprints #1263

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Landed in v0.0.144 as afec799c a85e52a8 defe450e 5ee108f4 via #1356. Release: https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.144. Closing this original.

nik

@nc9 nc9 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Local technology detection for logged-out audits from the pages already crawled

2 participants