NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · npm

CVE-2026-118764: minimatch has potential denial of service via globparts amplification

mediumCVSS 4.0 6.9GHSA-g3hv-75wg-m249

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 minimatch

Many 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 optimizationLevel of 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 with braceExpandMax and 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

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 entries