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: RequireJS fingerprint takes about 70 s on a 1 MB page of unclosed <script tags #1244
Technology detection runs every fingerprint over each stored page. On a hostile 1 MB page made of <script repeated 125,000 times, detection takes about 70 s of CPU. Measured one fingerprint at a time against that input, requirejs accounts for about 70.5 s of the 70.5 s total; every other pre-existing fingerprint takes about 1 ms or less.
The cause is the requirejs html pattern in packages/tech-detect/src/fingerprints/generated.ts: <script\b[^>]*\sdata-main\s*=\s*["'] has an unbounded [^>]*, so each unclosed <script scans to the end of the document (quadratic). The file is generated (scripts/generate-tech-fingerprints.ts, data in packages/tech-detect/data/research-fingerprints.json), so the fix belongs in the source data, then regenerate.
The existing ReDoS test in packages/tech-detect/tests/fingerprints.test.ts does not catch it: its adversarial inputs never contain a flood of unclosed <script tags.
Found while reviewing #1243 (new fingerprints there are bounded and gated; this one is pre-existing).
Acceptance Criteria
The requirejs html pattern is length-bounded (for example [^>]{0,300}) in the generator source data, and generated.ts is regenerated.
Every tech-detect fingerprint, run alone, takes under 250 ms on a 1 MB page made of <script repeated, and on 1 MB pages of repeated <script src=", <meta , <link and <img openers.
A regression test in packages/tech-detect/tests/ runs each fingerprint separately against those inputs and fails naming the slow fingerprint ids.
Detection of real RequireJS markup (<script data-main="js/main" src="require.js">) still matches.
I’ll take this. I’ll bound the RequireJS source pattern, regenerate the fingerprint output, and add the per-fingerprint adversarial-input regression described in the acceptance criteria, including the real RequireJS positive control.
Activity
fix(tech-detect): link patterns accept minified attributes, wider dyn…
WilliamK112 commentedon Oct 29, 2026
I’ll take this. I’ll bound the RequireJS source pattern, regenerate the fingerprint output, and add the per-fingerprint adversarial-input regression described in the acceptance criteria, including the real RequireJS positive control.
fix(tech-detect): anchor the Meta Pixel script URL pattern, 400 ms bo…
fix(tech-detect): bound unbounded fingerprint patterns, test every pa…
fix(tech-detect): link patterns accept minified attributes, wider dyn…
fix(tech-detect): anchor the Meta Pixel script URL pattern, 400 ms bo…
fix(tech-detect): bound unbounded fingerprint patterns (requirejs 70 …