GHSA-QXR8-Q827-836C
Vulnerability from github – Published: 2026-12-01 01:39 – Updated: 2026-12-01 01:39glob sets braceExpandMax: 10_000 when it parses pattern patterns, but the Ignore class builds its own minimatch options and omits braceExpandMax entirely, so ignore patterns fall back to minimatch's default of 100_000. Both paths force optimizationLevel: 2, which is the exact precondition for minimatch's globparts amplification (CVE-2026-118764, GHSA-g3hv-75wg-m249) — minimatch's own default is 1.
The consequence is that the same payload is rejected in milliseconds when passed as a pattern, but is accepted and burns far more CPU when passed as an ignore pattern.
Root cause
src/glob.ts:527-529 — pattern path, limit present:
const mmo: MinimatchOptions = {
braceExpandMax: 10_000,
...opts,
src/ignore.ts:71-83 — ignore path, limit missing:
this.mmopts = {
dot: true,
nobrace,
nocase,
noext,
noglobstar,
normalize,
optimizationLevel: 2, // forced, and the amplification precondition
platform,
nocomment: true,
nonegate: true,
windowsPathsNoEscape,
} // <-- no braceExpandMax
minimatch >= 11.0.1 fixed CVE-2026-118764 by throwing a RangeError once globParts.length >= braceExpandMax. The pattern path caps rows at 10_000; the ignore path allows 100_000. The amplified rows then go through minimatch's secondPhasePreProcess(), which is O(n²) pairwise partsMatch.
Reproduction
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
Impact
An attacker who can influence ignore patterns can force disproportionate CPU consumption on the event loop.
Fix
Issue is in src/ignore.ts. A minimal change closes them:
this.mmopts = {
+ braceExpandMax: 10_000,
dot: true,
nobrace,
nocase,
@@
this.slashRoot = escape(
slashRoot.replace(/\\/g, '/').replace(/\/$/, ''),
- { windowsPathsNoEscape },
+ { magicalBraces: true, windowsPathsNoEscape },
)
magicalBraces: truemakesescape()escape{and}as well, so the composed path stays literal and is not brace-expanded on re-parse.braceExpandMax: 10_000makes the ignore path use the same limit as the pattern path.
Verified: with this patch the ignore matcher becomes [['', 'root{7,8}', 'skip.log']] (one row, literal), matches /root{7,8}/skip.log, and the amplified ignore payload is rejected with the same error as the pattern path.
Regression tests are in test/ignore-braces.ts; they fail against the unpatched source and pass with the patch. The existing suite (test/ignore.ts, test/custom-ignore.ts, test/ignore-root.ts, test/pattern.ts, test/root.ts, test/absolute.ts) remains green: 167/167.
Tested on published glob@14.0.4 (current HEAD f26bdac). Earlier versions not checked.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 14.0.5"
},
"package": {
"ecosystem": "npm",
"name": "glob"
},
"ranges": [
{
"events": [
{
"introduced": "13.0.5"
},
{
"fixed": "14.0.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-137196"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-405",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-01T01:39:39Z",
"nvd_published_at": "2026-11-30T21:17:25Z",
"severity": "MODERATE"
},
"details": "`glob` sets `braceExpandMax: 10_000` when it parses *pattern* patterns, but the `Ignore` class builds its own `minimatch` options and omits `braceExpandMax` entirely, so ignore patterns fall back to minimatch\u0027s default of `100_000`. Both paths force `optimizationLevel: 2`, which is the exact precondition for minimatch\u0027s globparts amplification (CVE-2026-118764, GHSA-g3hv-75wg-m249) \u2014 minimatch\u0027s own default is `1`.\n\nThe consequence is that the same payload is rejected in milliseconds when passed as a pattern, but is accepted and burns far more CPU when passed as an ignore pattern.\n\n### Root cause\n\n`src/glob.ts:527-529` \u2014 pattern path, limit present:\n\n```ts\nconst mmo: MinimatchOptions = {\n braceExpandMax: 10_000,\n ...opts,\n```\n\n`src/ignore.ts:71-83` \u2014 ignore path, limit missing:\n\n```ts\nthis.mmopts = {\n dot: true,\n nobrace,\n nocase,\n noext,\n noglobstar,\n normalize,\n optimizationLevel: 2, // forced, and the amplification precondition\n platform,\n nocomment: true,\n nonegate: true,\n windowsPathsNoEscape,\n} // \u003c-- no braceExpandMax\n```\n\nminimatch `\u003e= 11.0.1` fixed CVE-2026-118764 by throwing a `RangeError` once `globParts.length \u003e= braceExpandMax`. The pattern path caps rows at `10_000`; the ignore path allows `100_000`. The amplified rows then go through minimatch\u0027s `secondPhasePreProcess()`, which is O(n\u00b2) pairwise `partsMatch`.\n\n### Reproduction\n\n```js\nimport { Volume, createFsFromVolume } from \u0027memfs\u0027\nimport { glob } from \u0027glob\u0027\n\nconst vol = new Volume()\nconst fs = createFsFromVolume(vol)\nvol.fromJSON({ \u0027/p/f.txt\u0027: \u0027x\u0027 })\n\n// 14 \u0027**/..\u0027 groups -\u003e 2^14 = 16384 rows, over the 10_000 limit\nconst payload = Array.from({ length: 14 })\n .map((_, i) =\u003e `**/../x${i}/y${i}`)\n .join(\u0027/\u0027)\n\nglob.sync(payload, { cwd: \u0027/p\u0027, fs, platform: \u0027posix\u0027 })\n// throws: optimizationLevel 2: too many patterns from \u0027**/..\u0027 (rejected fast)\n\nglob.sync(\u0027*\u0027, { cwd: \u0027/p\u0027, fs, ignore: [payload], platform: \u0027posix\u0027 })\n// accepted, ~1.5-2.0 s of CPU\n```\n\nMeasured on the published `glob@14.0.4`:\n\n```\npayload: 175 bytes\n as PATTERN : 6 ms REJECTED (optimizationLevel 2: too many patterns from \u0027**/..)\n as IGNORE : 1985 ms accepted\n```\n\n### Impact\n\nAn attacker who can influence ignore patterns can force disproportionate CPU consumption on the event loop.\n\n## Fix\n\nIssue is in `src/ignore.ts`. A minimal change closes them:\n\n```diff\n this.mmopts = {\n+ braceExpandMax: 10_000,\n dot: true,\n nobrace,\n nocase,\n@@\n this.slashRoot = escape(\n slashRoot.replace(/\\\\/g, \u0027/\u0027).replace(/\\/$/, \u0027\u0027),\n- { windowsPathsNoEscape },\n+ { magicalBraces: true, windowsPathsNoEscape },\n )\n```\n\n- `magicalBraces: true` makes `escape()` escape `{` and `}` as well, so the\n composed path stays literal and is not brace-expanded on re-parse.\n- `braceExpandMax: 10_000` makes the ignore path use the same limit as the\n pattern path.\n\nVerified: with this patch the ignore matcher becomes `[[\u0027\u0027, \u0027root{7,8}\u0027, \u0027skip.log\u0027]]` (one row, literal), matches `/root{7,8}/skip.log`, and the amplified ignore payload is rejected with the same error as the pattern path.\n\nRegression tests are in `test/ignore-braces.ts`; they fail against the unpatched source and pass with the patch. The existing suite (`test/ignore.ts`, `test/custom-ignore.ts`, `test/ignore-root.ts`, `test/pattern.ts`, `test/root.ts`, `test/absolute.ts`) remains green: 167/167.\n\nTested on published `glob@14.0.4` (current HEAD f26bdac). Earlier versions not checked.",
"id": "GHSA-qxr8-q827-836c",
"modified": "2026-12-01T01:39:39Z",
"published": "2026-12-01T01:39:39Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/isaacs/node-glob/security/advisories/GHSA-qxr8-q827-836c"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-137196"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-glob/commit/17cb20749bc65a64ec44d40de2736cc587564866"
},
{
"type": "PACKAGE",
"url": "https://github.com/isaacs/node-glob"
},
{
"type": "WEB",
"url": "https://github.com/isaacs/node-glob/releases/tag/v14.0.6"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Glob : `ignore` patterns lack the braceExpandMax limit applied to `pattern`"
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
How durations are calculated
Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation. The method is described in a publication.
Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.