CVE-2026-140007
## Summary 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. ## Root cause 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. ## Proof of concept Install minimatch 11.0.4, save as `poc.mjs`, and run with `node --max-old-space-size=128 --expose-gc poc.mjs`: ```js import { minimatch } from 'minimatch' for (let i = 0; i < 4; i++) { const pattern = `{1..100000}/unique-${i}` minimatch('no-match', pattern, { optimizationLevel: 2 }) global.gc() console.log(i + 1, process.memoryUsage()) } ``` On 11.0.4, the process terminates with: ```text FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory ``` The same command exits normally on 11.0.1. With three calls and the normal heap limit, forced-GC heap grew from 4.36 MB to 112.27 MB and RSS from 50.9 MB to 262.7 MB. As a smaller repeated control, ten independent processes each compiled ten unique 5,000-expansion patterns. On 11.0.4 the cached top-level function retained a median 17,371,504 heap bytes after forced GC. The direct `new Minimatch()` control retained 234,000 bytes, and the 11.0.1 top-level function showed no measurable retained-heap growth. ## Impact Applications that accept attacker-controlled glob patterns and call the top-level `minimatch()` func
Properties
- Severity
- medium
- Summary
- minimatch: Global pattern cache retains large expansions, enabling memory exhaustion
- Nvd fetched at
- 2026-12-02T06:37:54.190518+00:00
- Epss score
- 0.00459
- Cvss severity
- MEDIUM
- Cvss score
- 5.9
- Retrieved at
- 2026-12-02T06:40:14+00:00
- Ghsa published
- 2026-12-01T18:05:29Z
- Source url
- https://github.com/advisories/GHSA-hqmv-qgp3-jx75
- Ghsa updated
- 2026-12-01T18:05:30Z
- Ghsa id
- GHSA-hqmv-qgp3-jx75
- Last source
- FIRST EPSS
- Score
- 5.9
- Cvss version
- 3.1
- Cve id
- CVE-2026-140007
- Cvss vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-11-30T22:28:40+00:00
- Name
- CVE-2026-140007
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph