Inefficient regex backtracking in HTML Minifier Next slows minify()
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Attack requirements
- None
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 4.0 · CNA. Fix status from CNA. Impact type from CWE-1333.
Summary
HTML Minifier Next before 9.1.2 and html-minifier from 3.1.1 before 5.0.1 use ambiguous regular expressions in minify(). Long ignored or custom-fragment content can cause quadratic regex backtracking (CWE-1333), which can occupy a CPU core for seconds or minutes. A remote, unauthenticated attacker can trigger this by supplying crafted HTML to be minified.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
Description from the CNA
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.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
Remediation
Upgrade html-minifier-next to 9.1.2 and html-minifier to 5.0.1.
Written with Claude Haiku 5.5 from the sources below · 2026-11-30
- Fix · CNA html-minifier-next (j9t) Fixed in 9.1.2
- Fix · CNA html-minifier (j9t) Fixed in 5.0.1
Timeline
- 2026-11-30 Threatist record created from CVE-2026-140010
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences