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
tech-detect: Clarity loader in a double-escaped flight chunk is missed (#1477 residual) #1487
Residual of #1477. A corpus re-detect of the #1480 fix (flight text rows) recovers the Microsoft Clarity loaders that v0.0.150 found in a Next.js flight payload, except one real install: its standard loader (t.src="https://www.clarity.ms/tag/"+i) sits in a self.__next_f.push chunk of 16 KB or less with the URL double-escaped, a string inside a JSON string (\\\" around the URL), most likely an __html or children value held inside the props of a component the reader does not take for a script.
Acceptance Criteria
A synthetic flight fixture with the bare {type, children} loader beside two uses of a ref carrying src+strategy and id+strategy+children is detected, and a ref never seen with a strategy is not (amended 2026-11-01: the real shape is now known, replaces the double-escaped-string fixture)
The cause is written on this issue or in the PR body (satisfied by the PR body evidence)
Investigation with synthetic fixtures (the standard loader inside a flight row, 12 prop shapes; no site data). A string-in-string escape is NOT the problem: a children that is itself JSON text of the snippet is found, the same as a plain one. What is missed is a loader carried by a component that the reader does not take for a script, because it has neither a strategy nor an id beside the code:
found: next/script with id and children; a script element with __html; a component with a strategy and __html; children that are JSON text.
missed: a $L component with only dangerouslySetInnerHTML or only children (no id, no strategy); a component passing the code in another prop (code, script); __html on a div or children of a noscript; array children holding { __html }; dangerouslySetInnerHTML given as a JSON string.
So the likely cause on the one real site is a custom or third-party wrapper component. A fix exists in principle (read any string prop of a $L component that is code assigning a script URL, .src = "https://..."), but it also reads code samples a client component displays (a docs page showing the snippet in a code-block component), which is the false-positive class #1437 removed, and I cannot tell which wrapper the real site uses without it. Not built; this needs the site's actual props shape (its flight row, masked) to choose between that and nothing.
Corpus check, criterion 5: the single gained Clarity site on the v0.0.155 combined sample (Clarity 187 to 188) is the site this issue was filed about. It is also the only Clarity gain on the 33-shard A/B (769 to 770). The tag v0.0.155 differs from the sampled tree in one test line and no source file. With criteria 1 to 4 ticked earlier, every criterion now holds. Closing as completed.
Corpus check of the fix (#1490, shipped in v0.0.155): an A/B on 33 shards, 19,141 sites, #1490 against v0.0.154. 19,140 results identical. The only difference is one Clarity gain on the shape this issue describes (769 to 770 sites with Clarity). No losses; the PostHog, Vue and Square counts are unchanged. A combined 10-shard sample of v0.0.155 (5,877 sites) was 99.7% identical, with the same single Clarity gain.
Checked against v0.0.155. Ticked: criteria 1 (the synthetic fixture with the bare loader beside two uses of a ref is detected; a ref never seen with a strategy and a lookalike strategy are not), 2 (the cause is in the PR body), 3 (the #1437 negatives still pass) and 4 (hostile payloads stay inside their budgets, including the new pass-1 node budget and depth guard). Open: criterion 5, a re-detect of the one real affected site on the release head. The corpus comment above reports one Clarity gain on the shape this issue describes, from an A/B of #1490 against v0.0.154; it does not say that the gained site is the original one or that v0.0.155 detects it. Leaving this open until that is recorded.
Activity
nc9 commentedon Nov 1, 2026
Investigation with synthetic fixtures (the standard loader inside a flight row, 12 prop shapes; no site data). A string-in-string escape is NOT the problem: a
childrenthat is itself JSON text of the snippet is found, the same as a plain one. What is missed is a loader carried by a component that the reader does not take for a script, because it has neither astrategynor anidbeside the code:next/scriptwithidandchildren; ascriptelement with__html; a component with astrategyand__html; children that are JSON text.$Lcomponent with onlydangerouslySetInnerHTMLor onlychildren(noid, nostrategy); a component passing the code in another prop (code,script);__htmlon adivorchildrenof anoscript; array children holding{ __html };dangerouslySetInnerHTMLgiven as a JSON string.So the likely cause on the one real site is a custom or third-party wrapper component. A fix exists in principle (read any string prop of a
$Lcomponent that is code assigning a script URL,.src = "https://..."), but it also reads code samples a client component displays (a docs page showing the snippet in a code-block component), which is the false-positive class #1437 removed, and I cannot tell which wrapper the real site uses without it. Not built; this needs the site's actual props shape (its flight row, masked) to choose between that and nothing.nik
fix(tech-detect): read every use of a component ref that is next/scri…
fix(tech-detect): read every use of a component ref that is next/scri…
fix(tech-detect): read every use of a component ref that is next/scri…
nc9 commentedon Nov 1, 2026
Corpus check, criterion 5: the single gained Clarity site on the v0.0.155 combined sample (Clarity 187 to 188) is the site this issue was filed about. It is also the only Clarity gain on the 33-shard A/B (769 to 770). The tag v0.0.155 differs from the sampled tree in one test line and no source file. With criteria 1 to 4 ticked earlier, every criterion now holds. Closing as completed.
nik
nc9 commentedon Nov 1, 2026
Corpus check of the fix (#1490, shipped in v0.0.155): an A/B on 33 shards, 19,141 sites, #1490 against v0.0.154. 19,140 results identical. The only difference is one Clarity gain on the shape this issue describes (769 to 770 sites with Clarity). No losses; the PostHog, Vue and Square counts are unchanged. A combined 10-shard sample of v0.0.155 (5,877 sites) was 99.7% identical, with the same single Clarity gain.
nik
nc9 commentedon Nov 1, 2026
Checked against v0.0.155. Ticked: criteria 1 (the synthetic fixture with the bare loader beside two uses of a ref is detected; a ref never seen with a strategy and a lookalike strategy are not), 2 (the cause is in the PR body), 3 (the #1437 negatives still pass) and 4 (hostile payloads stay inside their budgets, including the new pass-1 node budget and depth guard). Open: criterion 5, a re-detect of the one real affected site on the release head. The corpus comment above reports one Clarity gain on the shape this issue describes, from an A/B of #1490 against v0.0.154; it does not say that the gained site is the original one or that v0.0.155 detects it. Leaving this open until that is recorded.
nik