Allocation of Resources Without Limits or Throttling Affecting minimatch package, versions >=11.0.3 <11.0.8


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.46% (42nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Allocation of Resources Without Limits or Throttling vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-MINIMATCH-23184407
  • published1 Dec 2026
  • disclosed30 Nov 2026
  • creditjankesec, agntflw, Adel Assakaf

Introduced: 30 Nov 2026

NewCVE-2026-140007  (opens in a new tab)
CWE-770  (opens in a new tab)

How to fix?

Upgrade minimatch to version 11.0.8 or higher.

Overview

minimatch is a minimal matching utility.

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the top-level minimatch() function, which stores compiled Minimatch objects in a module-level 256-entry Map bounded only by entry count and not by the total retained expansion weight. An attacker who can supply unique glob patterns containing large brace expansions (up to the braceExpandMax default of 100,000 rows per entry) can fill the cache with objects that collectively exhaust available heap memory, crashing the process. Direct construction with new Minimatch() is not affected by this cache behavior.

PoC

Install minimatch 11.0.4, save as poc.mjs, and run with node --max-old-space-size=128 --expose-gc poc.mjs:

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:

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.

Note: The PoC targets minimatch 11.0.4 and is run with Node.js using --max-old-space-size=128 --expose-gc flags.

CVSS Base Scores

version 4.0
version 3.1