Soumettre #1052004: highlightjs highlight.js 11.12.0 (tested back to 9.18.5) Denial of Serviceinformation

Titrehighlightjs highlight.js 11.12.0 (tested back to 9.18.5) Denial of Service
DescriptionProduct: highlight.js (highlightjs/highlight.js, JavaScript syntax highlighter; npm package) Affected versions: 11.12.0 (latest, 2026-08-12) and earlier releases; 16-release npm tarball matrix 9.18.5 through 11.11.1 in addition to live timing on 11.12.0. Unfixed; public issue #4529 open with zero vendor response since 2026-09-01. SUMMARY: 17 ReDoS-susceptible regexes across 15 shipped grammar files (es/languages/) cause quadratic-to-superlinear backtracking on attacker-influenced plain text. hljs.highlight() is synchronous and single-threaded; tens of kilobytes stall the Node.js event loop or browser main thread for seconds, and the growth is quadratic (about 4x runtime per input doubling), reaching hours for megabyte-scale input. ROOT CAUSE: ambiguous quantified runs in grammar regexes. Live-measured quadratic cases (Node v24.14.0, 2026-09-01, wall clock per hljs.highlight() call): livescript.js:285 -- payload slash followed by a-run: 10/36/144/585/2336/10981 ms at 1.25/2.5/5/10/20/40 KB; stan.js:485 -- 7/13/64/219/1157/4196 ms; csharp.js:181 -- 4/11/45/179/717/3215 ms; perl.js:266, scilab.js:59 and bash.js:114 show the same quadratic curve. Extrapolation: livescript 40 KB = 11 s -> 1 MB about 2.1 hours per request. 10 further patterns were flagged by recheck 4.5.0 automaton analysis; zephir.js:76 measured linear and is excluded from impact claims. REACHABILITY: hljs.highlight(text, {language}) and highlightAuto are the documented core API; there is no opt-in switch. A crafted input is highlighted whenever an affected grammar is registered (the common subset auto-registers several). Minimal PoC: require('highlight.js') v11.12.0; hljs.highlight('/' + 'a'.repeat(40000), {language: 'livescript'}) blocks about 11 s. IMPACT / CVSS: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L = 5.3 (Medium); A:L reflects measured quadratic (not exponential) growth and per-grammar scope. CWE-1333 (Inefficient Regular Expression Complexity). VENDOR PRECEDENT: the project own 2020 advisory GHSA-7wwv-vh3v-89cq (fixed 10.4.1, never assigned a CVE) treated grammar ReDoS as a security issue; issues #4362/#4361/#4462 (C/C++, XML) were accepted and fixed as security issues, including quadratic cases. FIX: bound or disambiguate quantified runs; replace backreference lazy wildcards with delimiter-aware runs; add a recheck CI gate on src/languages/*.js. Workarounds: cap input length, worker isolation with timeout, avoid registering affected grammars. DISCLOSURE: MITRE CNA-LR ticket 2100194 (MCID 15930963) was withdrawn; VulnCheck submission bfd133fa-a823-4c27-a0b0-4c343d470242 was rejected on 2026-10-05 (partial-pattern objection), so the issue is re-routed to VulDB. Public issue #4529 since 2026-09-01. DEDUP: NVD, GitHub Advisory Database (global API affects=highlight.js) and OSV queried. GHSA-7wwv-vh3v-89cq covers only <10.4.1 and has no CVE; CVE-2020-26237 is prototype pollution with a different root cause. The current 10.4.1-11.12.0 range has no existing CVE/GHSA.
La source⚠️ https://github.com/highlightjs/highlight.js/issues/4529
Utilisateur
 NeoWSY (UID 82976)
Soumission22/10/2026 13:26 (il y a 29 jours)
Modérer20/11/2026 17:58 (29 days later)
StatutAccepté
Entrée VulDB441503 [highlight highlight.js jusqu’à 11.12.0 Language Grammar livescript.js hljs.highlight text déni de service]
Points20

Do you know our Splunk app?

Download it now for free!