{"id":"CVE-2026-137196","aliases":["CVE-2026-137196","GHSA-qxr8-q827-836c"],"related":[],"kind":"vulnerability","state":"published","title":"Glob : `ignore` patterns lack the braceExpandMax limit applied to `pattern`","summary":"Glob matches files using patterns the shell uses. From 13.0.5 until 14.0.6, the Ignore class in src/ignore.ts does not pass braceExpandMax to minimatch while using optimizationLevel: 2, so attacker-influenced ignore patterns can amplify into more globparts than the regular pattern path permits and cause quadratic work in secondPhasePreProcess(). Applications that accept untrusted ignore patterns can therefore experience disproportionate event-loop CPU consumption and denial of service. This issue is fixed in version 14.0.6.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Glob matches files using patterns the shell uses. From 13.0.5 until 14.0.6, the Ignore class in src/ignore.ts does not pass braceExpandMax to minimatch while using optimizationLevel: 2, so attacker-influenced ignore patterns can amplify into more globparts than the regular pattern path permits and cause quadratic work in secondPhasePreProcess(). Applications that accept untrusted ignore patterns can therefore experience disproportionate event-loop CPU consumption and denial of service. This issue is fixed in version 14.0.6.","source":"cvelist"},{"lang":"en","text":"`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'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`.\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` — pattern path, limit present:\n\n```ts\nconst mmo: MinimatchOptions = {\n  braceExpandMax: 10_000,\n  ...opts,\n```\n\n`src/ignore.ts:71-83` — 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}                            // <-- no braceExpandMax\n```\n\nminimatch `>= 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`.\n\n### Reproduction\n\n```js\nimport { Volume, createFsFromVolume } from 'memfs'\nimport { glob } from 'glob'\n\nconst vol = new Volume()\nconst fs = createFsFromVolume(vol)\nvol.fromJSON({ '/p/f.txt': 'x' })\n\n// 14 '**/..' groups -> 2^14 = 16384 rows, over the 10_000 limit\nconst payload = Array.from({ length: 14 })\n  .map((_, i) => `**/../x${i}/y${i}`)\n  .join('/')\n\nglob.sync(payload, { cwd: '/p', fs, platform: 'posix' })\n// throws: optimizationLevel 2: too many patterns from '**/..'   (rejected fast)\n\nglob.sync('*', { cwd: '/p', fs, ignore: [payload], platform: 'posix' })\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 '**/..)\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, '/').replace(/\\/$/, ''),\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 `[['', '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.\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.","format":"markdown","source":"ghsa"}],"published":"2026-11-30T20:25:52.934Z","modified":"2026-12-01T01:45:03.942Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":6.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"}],"cwes":["CWE-400","CWE-405","CWE-770"],"affected":[{"ranges":[{"version":">= 13.0.5, < 14.0.6","status":"affected"}],"vendor":"isaacs","product":"node-glob","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"13.0.5","status":"affected","fixed":"14.0.6"}],"ecosystem":"npm","package":"glob","purl":"pkg:npm/glob","source":"ghsa"}],"references":[{"url":"https://github.com/isaacs/node-glob/security/advisories/GHSA-qxr8-q827-836c","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/isaacs/node-glob/commit/17cb20749bc65a64ec44d40de2736cc587564866","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/isaacs/node-glob/releases/tag/v14.0.6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137196","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/isaacs/node-glob","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-11-30T21:13:20.886Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-137196","url":"https://www.cve.org/CVERecord?id=CVE-2026-137196","licence":"CVE Terms of Use","modified":"2026-11-30T21:13:28.041Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-qxr8-q827-836c","url":"https://github.com/advisories/GHSA-qxr8-q827-836c","licence":"CC-BY-4.0","modified":"2026-12-01T01:45:03.942Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-137196","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-137196","licence":"Public domain","modified":"2026-11-30T22:17:27.937Z"}],"updatedAt":"2026-12-01T02:27:26.596Z","epss":{"score":0.00834,"percentile":0.58778,"date":"2026-12-01T12:00:22.000Z"}}