{"id":"CVE-2026-140010","aliases":["CVE-2026-140010"],"related":[],"kind":"vulnerability","state":"published","title":"HTML Minifier Next: Regular expressions in `minify()` cause O(n²) backtracking on ignored and custom-fragment content","summary":"HTML Minifier Next is a configurable HTML minifier and the enhanced successor to HTML Minifier. Prior to html-minifier-next 9.1.2, and from html-minifier 3.1.1 until 5.0.1, minify() in src/htmlminifier.js uses ambiguous regular expressions that can repeatedly rescan ignored or custom-fragment content. The ignoreCustomFragments whitespace-splitting variant dates to html-minifier 3.1.1, while html-minifier 5.0.0 carries both that variant and the RE_LAST_HTML_TAG variant used for htmlmin:ignore content. With collapseWhitespace enabled, a long htmlmin:ignore block without a matching tag reaches RE_LAST_HTML_TAG when the ignore-block placeholder and intervening text are followed by a real element; independently, a long whitespace run in a default custom fragment reaches the whitespace-splitting expression. Either form can cause quadratic regular-expression backtracking and occupy a CPU core for seconds or minutes. This issue is fixed in html-minifier-next 9.1.2 and html-minifier 5.0.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"HTML Minifier Next is a configurable HTML minifier and the enhanced successor to HTML Minifier. Prior to html-minifier-next 9.1.2, and from html-minifier 3.1.1 until 5.0.1, minify() in src/htmlminifier.js uses ambiguous regular expressions that can repeatedly rescan ignored or custom-fragment content. The ignoreCustomFragments whitespace-splitting variant dates to html-minifier 3.1.1, while html-minifier 5.0.0 carries both that variant and the RE_LAST_HTML_TAG variant used for htmlmin:ignore content. With collapseWhitespace enabled, a long htmlmin:ignore block without a matching tag reaches RE_LAST_HTML_TAG when the ignore-block placeholder and intervening text are followed by a real element; independently, a long whitespace run in a default custom fragment reaches the whitespace-splitting expression. Either form can cause quadratic regular-expression backtracking and occupy a CPU core for seconds or minutes. This issue is fixed in html-minifier-next 9.1.2 and html-minifier 5.0.1.","source":"cvelist"}],"published":"2026-11-30T21:44:38.140Z","modified":"2026-12-01T14:18:19.333Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":8.7,"rating":"HIGH"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":"< 9.1.2","status":"affected"}],"vendor":"j9t","product":"html-minifier-next","source":"cvelist"},{"ranges":[{"version":">= 3.1.1, < 5.0.1","status":"affected"}],"vendor":"j9t","product":"html-minifier","source":"cvelist"}],"references":[{"url":"https://github.com/j9t/html-minifier-next/security/advisories/GHSA-9wmg-23wv-h297","tags":["x-refsource-confirm"],"sources":["cvelist","nvd"]},{"url":"https://github.com/j9t/html-minifier-next/commit/28417322a9b0291de8b0d1c0694e09855d925545","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-12-01T13:51:07.333Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-140010","url":"https://www.cve.org/CVERecord?id=CVE-2026-140010","licence":"CVE Terms of Use","modified":"2026-12-01T13:51:51.871Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-140010","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140010","licence":"Public domain","modified":"2026-12-01T14:18:19.333Z"}],"updatedAt":"2026-12-01T14:32:19.155Z","epss":{"score":0.00483,"percentile":0.43235,"date":"2026-12-01T12:00:22.000Z"}}