Repository navigation
fix(crawler): keep the headers technology detection reads for local audits #871 - #923
Conversation
|
Review of #923 (local technology detection headers). I read the diff only. I did not run the tests or the build. The design holds up. Presence-only headers are stored as a marker, cookie values are never kept, values are capped at 512 characters, and the name list is guarded by tests against the fingerprints and WAF patterns. I found nothing that should block the merge.
Test coverage is good: the header-name drift guards, the crawler storage and cap behaviour, the incremental-reuse refresh, and the cloud payload check that no session value or token is sent. |
…udits #871 A local audit detects technologies from the page records the crawler stores, and the crawler kept only a fixed set of headers, so a header-only fingerprint (X-CDN: Imperva, X-Sucuri-ID, X-Varnish) never matched. - utils: TECH_DETECT_HEADER_NAMES (every header a tech-detect fingerprint or WAF provider reads), TECH_DETECT_PRESENCE_HEADERS (those read for presence only) and a 512-character cap per value. audit-engine tests keep both lists in step with the fingerprints and WAF providers. - crawler: stores techHeaders on each page: listed headers only, capped; presence-only headers (request ids, bot protection tokens) as "1"; Set-Cookie as cookie names. Refreshed when an incremental crawl reuses an unchanged page. - overlayTechHeaders: when a record carries techHeaders they speak for every listed header, so a header the response stopped sending cannot come back from a stale curated field. - CLI buildHeaderMap (local scan and cloud payload) and endpoint discovery's detection map use them. Rules keep buildHeadersMap unchanged. Closes #871 Signed-off-by: Nik Cubrilovic <[email protected]>
…871 Signed-off-by: Nik Cubrilovic <[email protected]>
d7e4398 to
e3dcbdf
Compare
|
Review triage, fixed in e3dcbdf (also rebased on main after #921):
|
|
Review of #923 (local technology detection reads stored headers). I read the diff only and did not run the tests. I found no blocking problems. Cookie values and presence-only tokens never reach storage or the cloud payload, and the tests check that.
Test coverage is good: end-to-end crawl fixtures, a reused cached page, truncation, and a check that no cookie value reaches the cloud payload. The changelog and docs are updated. |
|
Triage of the last review (e3dcbdf), nothing blocking:
|
In a local audit, technology detection now sees every response header a signature reads. Before, the crawler stored only a fixed subset, so header-only fingerprints such as
X-CDN: Imperva,X-Sucuri-IDandX-Varnishnever matched.Closes #871
What changed
@squirrelscan/utilsconstants.TECH_DETECT_HEADER_NAMES: the 45 headers that a tech-detect fingerprint, or a WAF provider in the Technologies section, reads.TECH_DETECT_PRESENCE_HEADERS: the 29 of those that are only tested for presence, such as request ids and Kasada/PerimeterX/DataDome tokens.Crawler.
ResponseHeaders.techHeadersis a new optional field. It is stored in the existingheadersJSON column, so there is no migration. It holds:"1"for a presence-only header, so tokens are never stored;set-cookieas cookie names only (name=per line).It is refreshed when an incremental crawl reuses an unchanged page.
overlayTechHeaders(utils/headers). When a record hastechHeaders(an object, ornullmeaning none were sent), it is authoritative for every listed header. A header the response stopped sending is dropped, so a stale curated value on a reused record cannot bring a removed technology back. An older record without the field reads as before.CLI
buildHeaderMapfeeds both the local scan and the cloud tech-detect payload. It now passes the stored detection headers, plus the curatedX-Powered-By,X-GeneratorandX-AspNet-Version, which were stored but not passed. Set-Cookie goes out as cookie names only, so session values and tokens never reach the cloud.Endpoint discovery's detection map (
buildTechHeadersMap) uses the same overlay. The rule-facingbuildHeadersMapis unchanged, so rules see the same headers as before.Acceptance criteria
type: "header"detector reads reaches local technology detection. The crawler stores them, and a coverage test checks the list againstALL_FINGERPRINTSand the waf-detectHEADER_PATTERNS.X-CDN: Impervalists Imperva. This is an end-to-end test: crawl, then site context, thendetectLocalTechnologies. Sucuri is tested the same way."1".Tests and checks
packages/audit-engine/tests/tech-detect-header-names-871.test.ts: list coverage, presence-set exactness, a crawler end-to-end test (capping, markers, cookie names, unlisted headers dropped), an incremental-reuse test (replacement, cookie removal, all headers removed) and unit tests for the overlay.apps/cli/tests/audit/tech-detect-local-headers-871.test.ts: the local scan finds Imperva and Sucuri; the cloud payload hasset-cookie: PHPSESSID=andx-kpsdk-ct: 1, and no cookie value or token.--strictandcheck-linkspass.Docs
docs/cloud/technologies.mdxnow describes:It also corrects "logged out or
--offline: skipped". The CLI already runs the same signatures locally in that case (#407).Skill impact
None. The
squirrelskill does not describe how technologies are detected or which headers are kept.