npm
CVE-2026-140008
minimatch: Quadratic compile time for long wildcard patterns (regression in 11.0.0 `mergeRows`)
- Severity
- High
- Published
- 1 Dec 2026
- Last changed
- 1 Dec 2026
- Added to UpHeron
- 1 Dec 2026
- Fixed in
- 11.0.7
- Exploit chance
- 0.5% in the next 30 daysHigher than 46% of CVEs. EPSS by FIRST, 1 Dec 2026
- Also known as
- GHSA-cf2h-pxjq-68xw
- Sources
- OSV.dev and GitHub
Description
Summary. mergeRows() (src/index.ts ~813-852, introduced in 2e1d896) iterates every part position and, for each row with a wildcard there, copies and joins the whole row to build a Map key. For a pattern made of many wildcard-only path parts this is quadratic in the number of parts, even with a single row. It runs in new Minimatch, so any uncached pattern pays it.
Measured on 11.0.6 with a pattern of * parts joined by /: 1000 parts 22 ms, 2000 parts 72 ms, 4000 parts 190 ms, 8000 parts 805 ms (about 4× per doubling). Extrapolated to the 64 KB pattern limit (~32,000 parts), one compile blocks for roughly 13 s. A leading brace group of distinct words multiplies the rows and the cost.
Suggested fix. Build merge keys incrementally (or hash per position) instead of joining the full row at each position, or skip merging when there is only one row; and count the work against braceExpandMax or a new limit.
Affected software
| Software | Affected versions |
|---|---|
minimatchnpm · osv:npm:minimatch |
|
About minimatch
- Weekly downloads (npm)
- 933,407,705npm, 2 Dec 2026
Vulnerabilities in minimatch
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-140006minimatch: minimatch.escape() output matches more or less than the literal inputMedium 5.4 1 Dec 2026
- CVE-2026-140007minimatch: Global pattern cache retains large expansions, enabling memory exhaustionMedium 5.9 1 Dec 2026
- CVE-2026-118764minimatch has potential denial of service via globparts amplificationMedium 30 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140008
- GitHub Advisory Database https://github.com/advisories/GHSA-cf2h-pxjq-68xw