CVE-2026-140006 — Minimatch — CWE-116
### Summary `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: 1. 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. 2. 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. 3. 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. When the pattern also contains a brace group, brace-expansion turns `\\` back into a single `\`, so the `*` becomes a live wildcard. The brace group can come from the caller (`escape(u) + '.{js,ts}'`) or, with default options, from the user text itself (`escape('x\\*{,}')`). 4. With `{ windowsPathsNoEscape: true, magicalBraces: true }`, `escape('x{a,b}')` returns `x[{]a,b[}]`. Brace-expansion does not know `[...]` classes and expands it to `x[]a]` and `x[b[]`. The pattern matches `xa` and does not match `x{a,b}`. The README documents negation and comments f
### Summary `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: 1. 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. 2. 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. 3. 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. When the pattern also contains a brace group, brace-expansion turns `\\` back into a single `\`, so the `*` becomes a live wildcard. The brace group can come from the caller (`escape(u) + '.{js,ts}'`) or, with default options, from the user text itself (`escape('x\\*{,}')`). 4. With `{ windowsPathsNoEscape: true, magicalBraces: true }`, `escape('x{a,b}')` returns `x[{]a,b[}]`. Brace-expansion does not know `[...]` classes and expands it to `x[]a]` and `x[b[]`. The pattern matches `xa` and does not match `x{a,b}`. The README documents negation and comments f
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-140006
CVSS 5.4/10 · MEDIUM · 30.11.2026
CWE: CWE-116
Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary
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:
1. A leading ! is left unescaped.
Affected: minimatch
⚡ ATTACK VECTOR
Network / Remote (AV:N) · low-privilege account (PR:L) · no user interaction (UI:N) · low attack complexity (AC:L).
🌍 REAL WORLD IMPACT
Partial confidentiality disclosure (C:L); limited integrity modification (I:L).
🛡️ REMEDIATION
→ Apply vendor security update for minimatch.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📋 Routine update cycle (30 days)
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]