All vulnerabilities

npm

CVE-2026-140007

minimatch: Global pattern cache retains large expansions, enabling memory exhaustion

Severity
Medium 5.9
Published
1 Dec 2026
Last changed
1 Dec 2026
Added to UpHeron
1 Dec 2026
Fixed in
11.0.8
Exploit chance
0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 1 Dec 2026
Weakness
Uncontrolled resource consumption (CWE-400)
Attack
Over the network · Only under certain conditions · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-hqmv-qgp3-jx75
Sources
OSV.dev and GitHub

Description

minimatch 11.0.3 through 11.0.7 retain the 256 most recent compiled Minimatch objects in a module-level cache. The cache is bounded only by entry count; each object can retain up to 100,000 expanded pattern rows. An application that passes untrusted, unique patterns to the top-level minimatch() function can therefore be terminated with a few very small inputs.

Commit 52d2aecceb71dae7f1b19675e74e044eb472c1e6 changed minimatch() to store each compiled object in a 256-entry Map. The key includes the complete pattern and options, so unique attacker-controlled patterns create distinct retained entries. There is no total cache-weight or per-entry expansion limit below the existing braceExpandMax default of 100,000.

The cache first ships in 11.0.3. Version 11.0.1 is a confirmed negative control.

Applications that accept attacker-controlled glob patterns and call the top-level minimatch() function can be crashed through memory exhaustion.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
minimatchnpm · osv:npm:minimatch
  • From 11.0.3 before 11.0.8

About minimatch

Weekly downloads (npm)
933,407,705npm, 2 Dec 2026

References