{"id":"CVE-2026-140008","aliases":["GHSA-cf2h-pxjq-68xw"],"url":"https://o3.security/vulnerability/CVE-2026-140008","summary":"minimatch: Quadratic compile time for long wildcard patterns (regression in 11.0.0 `mergeRows`)","details":"**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.\n\n**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.\n\n**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.","published":"2026-11-30T21:36:50.135Z","modified":"2026-12-01T21:02:40.653340827Z","cvss":null,"epss":{"score":0.00527,"percentile":0.46118,"asOf":"2026-12-01"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"minimatch","fixedVersion":"11.0.7"}],"fix":{"url":"https://github.com/isaacs/minimatch/commit/8a26917fa43e2b865dd6017f7acf6ac2fd5190cd","label":"isaacs/minimatch@8a26917"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/140xxx/CVE-2026-140008.json"},{"type":"ADVISORY","url":"https://github.com/isaacs/minimatch/security/advisories/GHSA-cf2h-pxjq-68xw"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-140008"},{"type":"FIX","url":"https://github.com/isaacs/minimatch/commit/8a26917fa43e2b865dd6017f7acf6ac2fd5190cd"},{"type":"PACKAGE","url":"https://github.com/isaacs/minimatch"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-12-01T21:02:40.653340827Z"}}