CVE-2026-140008: minimatch: Quadratic compile time for long wildcard patterns (regression in 11.0.0 `mergeRows`)
minimatch is a minimal matching utility for converting glob expressions into JavaScript RegExp objects. From 11.0.0 until 11.0.7, mergeRows() in src/index.ts repeatedly copies and joins an entire pattern row while iterating each wildcard position, causing quadratic compilation time for long wildcard-only path patterns even when only one row exists. An attacker who can supply uncached patterns to new Minimatch or another compiling entry point can block the JavaScript event loop and cause a denial of service, with brace-generated rows further multiplying the work. This issue is fixed in version 11.0.7.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
minimatchto a version that resolves this vulnerability.Fixed in 11.0.7
Event History
Frequently Asked Questions
Which applications are realistically exposed to this denial of service?
Applications are exposed when an attacker can supply long wildcard-only glob patterns that reach a new Minimatch instance or another pattern-compilation entry point. The impact is greater when supplied patterns are uncached, because compilation can block the JavaScript event loop.
What pattern characteristics make exploitation more expensive?
Long patterns containing wildcard positions trigger repeated copying and joining of the pattern row during compilation. Brace-generated rows can multiply the amount of work further.
What versions should be remediated?
The affected range is minimatch 11.0.0 through 11.0.7. Update to version 11.0.7, which contains the fix.
What can be done if an immediate update is not possible?
Restrict or validate untrusted glob patterns before they reach Minimatch compilation, particularly long wildcard-only patterns and patterns that generate rows through braces. Avoid repeatedly compiling attacker-controlled patterns without caching or request-level limits.