Skip to content

fix(deps): update dependency glob to v14 [security] - #25

Closed
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-glob-vulnerability
Closed

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/npm-glob-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
glob ^10.3.10 → ^14.0.0 age confidence

Warning

Some dependencies could not be looked up. Check the Dependency Dashboard for more information.


Glob : ignore patterns lack the braceExpandMax limit applied to pattern

CVE-2026-137196 / GHSA-qxr8-q827-836c

More information

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'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 [email protected]:

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: true makes escape() escape { and } as well, so the
    composed path stays literal and is not brace-expanded on re-parse.
  • braceExpandMax: 10_000 makes 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 [email protected] (current HEAD f26bdac). Earlier versions not checked.

Severity

  • CVSS Score: 6.3 / 10 (Medium)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Glob: AbortSignal cancellation bypass allows post-timeout filesystem traversal

CVE-2026-118773 / GHSA-3g3m-2fjr-6pw4

More information

Details

Summary

In glob 13.0.6, an aborted async walk rejects or emits an error but continues recursively reading directories in the background.

The root cause is that abort branches in src/walker.ts call cb() without returning. As a result, callers that rely on signal or AbortSignal.timeout() to bound glob traversal cost can still incur filesystem I/O and CPU work after the request has already been rejected.

Details

This was reproduced on glob v13.0.6 (commit e80cb38ae60d6cbff9e75f39032a994858994d35).

The README documents that the signal option cancels the glob walk. However, in src/walker.ts, the following methods call cb() when this.signal?.aborted is true but do not return:

  • GlobUtil.walkCB()
  • GlobUtil.walkCB2()
  • GlobUtil.walkCBSync()
  • GlobUtil.walkCB2Sync()

Example vulnerable pattern:

if (this.signal?.aborted) cb()

Because execution continues after cb(), the walker still reaches processor.processPatterns(), readdirCB(), and recursive walkCB2() calls.

The issue was directly demonstrated against v13.0.6. A source-history review shows the same missing-return pattern is present in tagged releases from v9.0.0 through v13.0.6.

The issue affects both glob() and globStream().

Recommended fix:
Change each abort branch to return immediately:

if (this.signal?.aborted) return cb()

Proof of concept

Environment:

  • Linux x86_64
  • Node.js v22.23.3
  • npm 10.9.9
  • glob 13.0.6

Reproduction steps:

  1. Install the affected package:
    npm init -y
    npm install [email protected]

  2. Run the attached PoC:
    node poc/abort-continues-work.mjs

The PoC aborts after the first readdir() call, waits briefly, and counts how many more directory reads happen after the promise has already rejected.

Observed output on the vulnerable version:

{
"rejection": "Error: probe-abort",
"readdirCalls": 1365,
"readdirCallsAtReject": 5,
"readdirCallsAfterReject": 1360
}

Expected behavior:
readdirCallsAfterReject should be 0.

A second PoC using AbortSignal.timeout() also reproduces the issue:

{
"rejection": "TimeoutError: The operation was aborted due to timeout",
"readdirCalls": 133,
"readdirCallsAtReject": 1,
"readdirCallsAfterReject": 132
}

The same test against a patched build with return cb() in the four abort branches stops immediately:

{
"readdirCalls": 1,
"readdirCallsAtReject": 1,
"readdirCallsAfterReject": 0
}

Impact

This is an availability issue.

Applications that expose globbing over attacker-influenced patterns or attacker-controlled directory trees and use AbortSignal / AbortSignal.timeout() as a traversal budget can still perform significant filesystem I/O and CPU work after a request has already timed out or been canceled.

Repeated timed-out requests can stack background glob walks and degrade worker throughput or service availability.

No confidentiality or integrity impact was observed.

Severity

  • CVSS Score: 6.3 / 10 (Medium)
  • Vector String: 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

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

isaacs/node-glob (glob)

v14.0.6

Compare Source

  • ignore patterns lack the braceExpandMax limit applied to pattern

Fixes GHSA-qxr8-q827-836c: GHSA-qxr8-q827-836c

v14.0.5

Compare Source

v14.0.4

Compare Source

v14.0.3

Compare Source

v14.0.2

Compare Source

v14.0.1

Compare Source

v14.0.0

Compare Source

v13.0.7

Compare Source

v13.0.6

Compare Source

v13.0.5

Compare Source

v13.0.4

Compare Source

v13.0.3

Compare Source

v13.0.2

Compare Source

v13.0.1

Compare Source

v13.0.0

Compare Source

v12.0.0

Compare Source

v11.1.0

Compare Source

v11.0.3

Compare Source

v11.0.2

Compare Source

v11.0.1

Compare Source

v11.0.0

Compare Source


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2da0d479-78ab-4b3e-818a-0bca25c9b20f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@developing-today-backup
developing-today-backup Bot deleted the renovate/npm-glob-vulnerability branch November 26, 2026 11:45
@renovate renovate Bot changed the title fix(deps): update dependency glob to v14 [security] Update dependency glob to v14 [SECURITY] Nov 26, 2026
@renovate renovate Bot changed the title Update dependency glob to v14 [SECURITY] fix(deps): update dependency glob to v14 [security] Nov 26, 2026
@renovate renovate Bot changed the title fix(deps): update dependency glob to v14 [security] Update dependency glob to v14 [SECURITY] Nov 28, 2026
@renovate renovate Bot changed the title Update dependency glob to v14 [SECURITY] fix(deps): update dependency glob to v14 [security] Nov 29, 2026
@renovate
renovate Bot force-pushed the renovate/npm-glob-vulnerability branch from b8b51da to 05c3202 Compare December 1, 2026 02:05
@renovate
renovate Bot force-pushed the renovate/npm-glob-vulnerability branch from 05c3202 to e1c16ca Compare December 1, 2026 06:03
@developing-today-fleet

Copy link
Copy Markdown
Contributor

Closed as SUPERSEDED — lane 2337-C (alpha DRIVE 2026-11-30), full-diff verify.

This PR bumps glob in pkgs/desktop-commander to v14. PR #46, the same bump to v15 for the same package and files, was verified (glob-orbit-only lockfile transitions: glob 10.5.0 -> 15.0.0, minimatch 9.0.9 -> 11.0.10, path-scurry 1.11.1 -> 4.1.0, old glob subtree removed, no npmmirror resolved URLs) and MERGED 2026-12-01T06:07:45Z, merge commit 521af5a. Desktop-commander is now on glob ^15.0.0, so this v14 PR has no remaining purpose. Reopen only if glob v15 is reverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants