CVE-2026-140010
## Summary html-minifier-next finds the last HTML tag inside htmlmin:ignore blocks with the expression /[\s\S]*<(\/?[a-zA-Z][\w:-]*)/. A large ignore block without a matching tag makes the greedy prefix rescan the content, so the public minify() API takes about 89 seconds for 256 KB. A second expression with the same flaw, `/^(\s*)[\s\S]?(\s)$/`, splits whitespace off matches of `ignoreCustomFragments`. A long whitespace run inside such a fragment triggers it with default options, since the default fragments cover `<? … ?>` and `<% … %>` (64 KB: about 3.3 s). ## Affected component and version - Repository: `j9t/html-minifier-next` - Affected version(s): Affected version(s): all releases up to and including 9.1.1 - Component: src/htmlminifier.js:691 (`RE_LAST_HTML_TAG`), :1795 (exec on `htmlmin:ignore` content, requires `collapseWhitespace`); src/htmlminifier.js:1279 (whitespace split of `ignoreCustomFragments` matches, default options) - Status: the vulnerable expression is present at the referenced revision; no fix was identified at the time of reporting. html-minifier is affected as well: The custom-fragment issue dates back to html-minifier 3.1.1, and 5.0.0, rebuilt on HTML Minifier Next 9.1.1, carries both. ## Reproduction input minify() on a document containing a large htmlmin:ignore block whose content is plain text with no '<tag' terminator (N=256000 characters). ## Measured timings The following values were measured against the real code path described above. Times are wall-clock milliseconds. ``` node e2e_htmlmin2.mjs → "n=4000 len=4021 ms=5.8 / n=8000 len=8021 ms=20.8 / n=16000 len=16021 ms=92.7 / n=32000 len=32021 ms=333.0";node -e(64000/128000/256000)→ 1461 / 16511 / 89226 ms。源码 src/htmlminifier.js:691 `const RE_LAST_HTML_TAG = /[\s\S]*<(\/?[a-zA-Z][\w:-]*)/;`,使用点 :1795 `RE_LAST_HTML_TAG.exec(content)`;公开入口 :2997 `export const minify = async function (value, options)`。control(短 ignore 块)ms<1。 ``` Additional finding (maintainer) Input: `<p><?p
Properties
- Severity
- high
- Summary
- HTML Minifier Next: Regular expressions in `minify()` cause O(n²) backtracking on ignored and custom-fragment content
- Nvd fetched at
- 2026-12-02T06:37:54.190518+00:00
- Epss score
- 0.00483
- Cvss severity
- HIGH
- Cvss score
- 8.7
- Retrieved at
- 2026-12-02T06:40:14+00:00
- Ghsa published
- 2026-12-01T17:56:57Z
- Source url
- https://github.com/advisories/GHSA-9wmg-23wv-h297
- Ghsa updated
- 2026-12-01T17:57:00Z
- Ghsa id
- GHSA-9wmg-23wv-h297
- Last source
- FIRST EPSS
- Score
- 8.7
- Cvss version
- 4.0
- Cve id
- CVE-2026-140010
- Cvss 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
- First seen by Signal
- 2026-11-30T22:28:40+00:00
- Name
- CVE-2026-140010
- Is ghsa only
- false
- 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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
Related Entities (5)
AFFECTS (2)
VULNERABLE_TO (2)
HAS_WEAKNESS (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph