All vulnerabilities

npm

CVE-2026-140006

minimatch: minimatch.escape() output matches more or less than the literal input

Severity
Medium 5.4
Published
1 Dec 2026
Last changed
1 Dec 2026
Added to UpHeron
1 Dec 2026
Fixed in
11.0.8
Exploit chance
0.3% in the next 30 daysHigher than 22% of CVEs. EPSS by FIRST, 1 Dec 2026
Weakness
Improper output encoding (CWE-116)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read some data · Change some data
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
Also known as
GHSA-c859-jr93-m5j4
Sources
OSV.dev and GitHub

Description

minimatch.escape() is documented to "Escape all magic characters in a glob pattern, so that it will only ever match literal strings." (README, section minimatch.escape(pattern, options = {})). In minimatch 11.0.5 (latest release; main is at the v11.0.5 tag, commit ea0a4a6) four classes of input break that contract:

  • A leading ! is left unescaped. escape('!secret.txt') returns '!secret.txt', which is a negated pattern. It matches every path except secret.txt, for example passwd. This holds in POSIX mode and in windowsPathsNoEscape mode.
  • A leading # is left unescaped. escape('#notes.md') returns '#notes.md', which is a comment pattern. It matches nothing, including #notes.md. This holds in both modes.
  • An escaped backslash does not survive brace expansion. For the user text x\ (x, backslash, star), escape() returns x\. Alone, that pattern matches only the literal.
From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
minimatchnpm · osv:npm:minimatch
  • From 7.4.0 before 11.0.8

About minimatch

Weekly downloads (npm)
933,407,705npm, 2 Dec 2026

References