You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rendered audits miss scripts the server HTML references when client code removes them after hydration #1769
In a rendered (cloud or render-mode) audit, script discovery and secret scanning read the DOM snapshot taken right after domcontentloaded. Some frameworks remove server-rendered head scripts once hydration finishes. TanStack Router's Script component, for example, returns null after useHydrated(), so React drops the server nodes. Whether the audit sees those scripts then depends on whether the snapshot lands before or after hydration.
Observed on our own test site: the server HTML of a product page contained <script src="/_fault/shop-config.js"> and an inline script, and curl returned both. A slow render (about 1.5 s) stored a DOM without them. As a result:
the external script was never fetched;
security/leaked-secrets did not report a key the server shipped to every visitor;
perf/critical-request-chains and perf/unminified-js stopped listing the script.
A fast render (about 0.5 s) of the same build kept them. A later run of the same page reused the slow render from the render cache, so it repeated the miss.
A script the server sends is public, whether or not client code later removes it from the DOM, so it has to be audited.
Acceptance Criteria
For a rendered page, the scripts that are fetched and scanned (external src and inline bodies) are the union of those in the server HTML and those in the rendered DOM.
security/leaked-secrets reports a secret in a script that only the server HTML contains, and the finding names the page.
Rules that list page scripts (critical request chains, unminified JS, render-blocking) see a server-HTML-only script at least once, as a server-sent resource. Each rule decides whether a removed script still counts for its own purpose, and the docs say which.
An engine-level test uses a local fixture whose served HTML includes a script and whose rendered DOM does not. It covers both the v1 and the streaming engine.
The result does not depend on render timing: the same page gives the same script set for a fast and a slow render.
Activity
fix(crawler): audit server-sent scripts that client code removes afte…
feat(audit-engine): carry an optional serverHtml on a cloud render re…
fix(crawler,engine): one redirect rule (#1762) and the review follow-…
nc9 commentedon Nov 12, 2026
Not closed after v0.0.179 (https://github.com/squirrelscan/squirrelscan/releases/tag/v0.0.179). Local renders audit the union of server and rendered scripts (parser, engine and e2e tests). Still open: the hosted render path (private repo#4022) and rule-level tests that critical-request-chains, unminified-js and render-blocking see a server-only script. The change that shipped is 7f8598e.
nik
nc9 commentedon Nov 13, 2026
Shipped in v0.0.179. Implemented in 7f8598e (an ancestor of the v0.0.179 tag), and described in that release's CHANGELOG entry for #1769.
nik