HTML Minifier Next denial of service in minify() via crafted HTML
Affects html-minifier-next up to 9.1.1 and html-minifier 3.1.1 through 5.0.x with long htmlmin:ignore blocks (collapseWhitespace on) or long whitespace runs in a default custom fragment. Fixed in 9.1.2 and 5.0.1.
- Exploited
- No known exploitation
- Fix
- Fixed in html-minifier-next 9.1.2 · html-minifier 5.0.1
- Who is exposed
- Not reported
Summary
HTML Minifier Next and HTML Minifier are affected. A remote attacker, without logging in, can send crafted HTML with a long ignored block or a long run of whitespace, causing `minify()` to tie up a CPU core for seconds or minutes.
Written by a model
Original description
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.
What to do
Upgrade to a fixed version: html-minifier-next 9.1.2 · html-minifier 5.0.1.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-140010 (HTML Minifier Next: Regular expressions in `minify()` cause O(n²) backtracking on ignored and custom-fragment content), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-140010 (entry last updated 2026-11-30):
Affected:
- j9t html-minifier-next: fixed in 9.1.2
- j9t html-minifier: from 3.1.1, fixed in 5.0.1
Fixed versions: 9.1.2, 5.0.1.
Conditions (all must be true for the bug to be hit):
- Long htmlmin:ignore block with collapseWhitespace enabled (source: https://github.com/j9t/html-minifier-next/security/advisories/GHSA-9wmg-23wv-h297)
- Long whitespace run inside a default custom fragment (source: https://github.com/j9t/html-minifier-next/security/advisories/GHSA-9wmg-23wv-h297)
- html-minifier-next releases up to and including 9.1.1, and html-minifier 3.1.1 through 5.0.x (source: https://github.com/j9t/html-minifier-next/security/advisories/GHSA-9wmg-23wv-h297)
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
Attacker needs: network access, no login, no user action.
CISA KEV: CVE-2026-140010 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-140010 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/j9t/html-minifier-next/security/advisories/GHSA-9wmg-23wv-h297
- https://github.com/j9t/html-minifier-next/commit/28417322a9b0291de8b0d1c0694e09855d925545
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-140010
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-140010"}.Affected versions
- j9t html-minifier-nextfixed in 9.1.2
- j9t html-minifierFrom 3.1.1 · fixed in 5.0.1
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure17/25No login or user action needed, reachable over the network without a login · Unknown: Advisories don't say whether default setups are affected
- Reach?/20Unknown. No tracked technology or package matched
- Severity8.7/10CVSS 8.7
- No patch0/5No signal
What would change the score
- Would score about 71 if added to CISA KEV
- Would score about 66 if CISA's SSVC rates exploitation active
- Would score about 31 if advisories confirm default setups are exposed
Timeline
- CVE published
- First seen by cve.now
Evidence 4
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · j9t/html-minifier-next · Advisory GHSA-9wmg-23wv-h297 |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-140010 |
| Record | NVD · CVE-2026-140010 |
| Other links 1 | |
| Repository | GitHub · j9t/html-minifier-next · Commit 28417322 |
Questions about CVE-2026-140010
Is CVE-2026-140010 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
Regular expressions in minify() backtrack quadratically on long ignored blocks and long whitespace runs, so processing time grows very fast with input size. This can tie up a CPU core for seconds to minutes and cause denial of service in the process calling minify().
Source: github.com
Which versions are affected by CVE-2026-140010?
html-minifier-next: before 9.1.2. html-minifier: from 3.1.1 before 5.0.1.
Source: cve.now feed data
Am I affected, and how do I check?
html-minifier-next releases up to and including 9.1.1, and html-minifier from 3.1.1 through 5.0.x. The slow path needs a long htmlmin:ignore block with collapseWhitespace enabled, or a long whitespace run inside a default custom fragment. To check a project, look at the installed html-minifier-next or html-minifier version in package.json or the output of npm ls.
Source: github.com
How do I fix CVE-2026-140010?
Upgrade html-minifier-next to 9.1.2 or later, or html-minifier to 5.0.1 or later.
Source: github.com
Related
- CVE-2026-140095python-semver: super-quadratic ReDoS in _LAST_NUMBER via attacker-controlled version strings
- CVE-2026-139998React Router: Polynomial-time ReDoS in matchPath and matchRoutes trailing-slash handling
- CVE-2026-104199aMQTT: Inefficient Regular Expression Complexity and Uncontrolled Resource Consumption and Improper Input Validation
- CVE-2026-135804Incomplete Fix for CVE-2026-45756: JsonPath Queries Can Still Hold a Process Through search(), match() and Chained Filters
- CVE-2026-129229NLTK: Compile-time regex DoS in NLTK search/tokenizer sinks: quadratic regex-engine compile bypasses the match-only timeout
- CVE-2026-133161Harness `ToolOutputLimits` ANSI stripping can take quadratic time, blocking the event loop
No corrections so far. Something wrong on this page? Report an error.