CVE-2026-118764: minimatch has potential denial of service via globparts amplification
minimatch before 11.0.1 can be driven into heavy CPU and memory use by a crafted glob pattern. The `**/..` handling in `firstPhasePreProcess()` multiplies pattern entries, and a quadratic comparison pass follows. Any service that compiles glob patterns from untrusted input is exposed. Upgrade to minimatch 11.0.1.
Published Oct 30, 2026 · Updated Nov 4, 2026 · Analysis Oct 31, 2026
What an attacker can do
When optimizationLevel is 2 or higher, firstPhasePreProcess() rewrites each **/.. segment. It clones the globParts entry, replaces the segment with ** and pushes the clone back onto the same array. This runs inside a do...while (didSomething) loop, so the clones are processed again. A pattern with many **/.. segments therefore grows the list sharply.
The enlarged list then goes to secondPhasePreProcess(). It compares every pair of entries through partsMatch, which is quadratic work. A short attacker string becomes a large allocation and a long CPU burn.
The attacker needs only to get a pattern into minimatch. Servers that take globs from API parameters, config uploaded by users, .gitignore-style files or package metadata are the realistic targets. The effect is availability: a blocked Node.js event loop and rising memory. The CVSS 4.0 vector rates it network, no privileges, no interaction, low availability impact. It gives no code execution and no data access.
Who is affected
All minimatch versions below 11.0.1 are listed as vulnerable. The advisory text describes 10.2.6. The issue only applies when optimizationLevel is 2 or higher, and your application must pass untrusted patterns to minimatch. List every copy in your tree, including transitive ones:
npm ls minimatchMany build tools and glob pull minimatch in indirectly, so check lockfiles of each project.
minimatch
- Ecosystem
- npm
- Affected
- >= 7.0.0, < 11.0.1
- Fixed in
- 11.0.1
- Check
npm ls minimatch
How to fix it
Upgrade to minimatch 11.0.1.
npm install [email protected]For transitive copies, use an overrides entry in package.json or update the parent package. The fix limits **/.. splitting by the existing braceExpandMax option (default 100,000). It also skips the pairwise deduplication when there are more than 1,000 pattern sets. Matching results stay the same. The sources give no other workaround. Until you upgrade, avoid passing untrusted patterns to minimatch, or limit their length.
How to tell if you were hit
Look for Node.js processes that spend long periods at full CPU or grow in memory right after a request that carries a glob pattern. Event-loop lag and request timeouts on endpoints that compile patterns are the usual signs. Check access logs and stored patterns for strings with many repeated **/.. segments. The advisory documents no log line.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
minimatch 10.2.6 contains an attacker-controlled pattern amplification in firstPhasePreProcess() when optimizationLevel >= 2.
researcher: Reid Downing (b1nv0id) files:
- src/index.ts: 690-770
- src/index.ts: 780-796
issue: input-controlled growth of globParts during first-phase preprocessing, followed by quadratic second-phase processing.
the **/../ transformation clones a globparts entry and appends the clone to the same globparts array:
parts.splice(gs, 1)
const other = parts.slice(0)
other[gs] = '**'
globParts.push(other)this occurs inside a do...while (didSomething) fixpoint loop, allowing generated entries to be processed again.
the expanded globparts array is subsequently processed by secondPhasePreProcess(), which performs pairwise comparisons:
for (let i = 0; i < globParts.length - 1; i++) {
for (let j = i + 1; j < globParts.length; j++) {
this.partsMatch(...)
}
}an attacker who can supply a glob pattern can therefore cause additional pattern entries to be generated during preprocessing, followed by quadratic pairwise processing, resulting in excessive cpu and memory consumption.
Credited to b1nv0id, ramonpzg, mgx-systems, 1abcdefggs, khucanhduy9-cloud, worldwideskier-alpine, yadinesh1.
Questions
- Does this need special options?
The advisory ties the amplification to
optimizationLevelof 2 or higher. Your code must also feed attacker-controlled patterns to minimatch.- Which minimatch version fixes CVE-2026-118764?
11.0.1. It caps the
**/..expansion withbraceExpandMaxand skips the quadratic dedup for sets over 1,000 entries.- Can this lead to code execution?
No. The advisory describes only excessive CPU and memory use, which is a denial of service (CWE-405).
- Is it exploited in the wild?
No source reports exploitation, and the entry is not in CISA's KEV catalog. The EPSS score is 0.0029.
References
Read for this analysis:
- https://github.com/isaacs/minimatch/security/advisories/GHSA-g3hv-75wg-m249
- https://github.com/isaacs/minimatch/commit/77a0f5c4b80bdc641c3c930a1d9edf5ad2db57f8
- https://nvd.nist.gov/vuln/detail/CVE-2026-118764
- https://github.com/isaacs/minimatch/releases/tag/v11.0.1
- https://github.com/isaacs/minimatch/commit/297b6c1a01f2410b3ba1ebed14ba222d0c3c1033
- https://github.com/isaacs/minimatch/commit/fd0b3ab9cbc5bf1aff1c99f1f46e413c2b3340da
- https://github.com/advisories/GHSA-g3hv-75wg-m249
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-27903
minimatch has ReDoS: matchOne() combinatorial backtracking via multiple non-adjacent GLOBSTAR segments
high7.5Feb 26, 2026CVE-2026-27904
minimatch ReDoS: nested *() extglobs generate catastrophically backtracking regular expressions
high7.5Feb 26, 2026CVE-2026-26996
minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern
high8.7Feb 18, 2026
