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
- 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.
Affected software
| Software | Affected versions |
|---|---|
minimatchnpm · osv:npm:minimatch |
|
About minimatch
- Weekly downloads (npm)
- 933,407,705npm, 2 Dec 2026
Vulnerabilities in minimatch
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- CVE-2026-140007minimatch: Global pattern cache retains large expansions, enabling memory exhaustionMedium 5.9 1 Dec 2026
- CVE-2026-140008minimatch: Quadratic compile time for long wildcard patterns (regression in 11.0.0 `mergeRows`)High 1 Dec 2026
- CVE-2026-118764minimatch has potential denial of service via globparts amplificationMedium 30 Oct 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-140006
- GitHub Advisory Database https://github.com/advisories/GHSA-c859-jr93-m5j4