CVE-2026-141514 — Minimatch — CWE-1321
### Summary minimatch's module-global matcher cache can be poisoned by a `__proto__` key in the `options` object passed to `minimatch()`. `optionsKey()` scores that key the same as no options at all, while `copyOptions()`'s bare `for...in` loop re-parents its copy onto the attacker's prototype instead of copying it as an own property — one caller doing this is enough to flip the cached matcher's case-sensitivity for every later, unrelated caller matching the same pattern string. ### Details `src/index.ts:229-234`, `optionsKey()` has no `case '__proto__'`, so it falls through to `default` and contributes weight `0`: ```ts const optionsKey = (o: MinimatchOptions): number | string => { for (const k in o) { switch (k) { // ... no 'case "__proto__":' branch ... default: n += (booleanWeights.get(k) ?? 0) * tri(v) ``` `src/index.ts:291-296`, `copyOptions()` copies with a plain assignment, not `Object.defineProperty`, so `__proto__` runs through the real setter instead of landing as an own key: ```ts const copyOptions = (o?: MinimatchOptions) => { const copy: Record<string, unknown> = {} for (const k in o) copy[k] = (o as Record<string, unknown>)[k] return copy as MinimatchOptions } ``` `cachedMinimatch()` (`src/index.ts:298-323`) then stores the `Minimatch` built from the poisoned `copyOptions(options)` under the key `optionsKey(options)` returns — the same key a later, option-less call will look up. Neither function has the one missing ch
### Summary minimatch's module-global matcher cache can be poisoned by a `__proto__` key in the `options` object passed to `minimatch()`. `optionsKey()` scores that key the same as no options at all, while `copyOptions()`'s bare `for...in` loop re-parents its copy onto the attacker's prototype instead of copying it as an own property — one caller doing this is enough to flip the cached matcher's case-sensitivity for every later, unrelated caller matching the same pattern string. ### Details `src/index.ts:229-234`, `optionsKey()` has no `case '__proto__'`, so it falls through to `default` and contributes weight `0`: ```ts const optionsKey = (o: MinimatchOptions): number | string => { for (const k in o) { switch (k) { // ... no 'case "__proto__":' branch ... default: n += (booleanWeights.get(k) ?? 0) * tri(v) ``` `src/index.ts:291-296`, `copyOptions()` copies with a plain assignment, not `Object.defineProperty`, so `__proto__` runs through the real setter instead of landing as an own key: ```ts const copyOptions = (o?: MinimatchOptions) => { const copy: Record<string, unknown> = {} for (const k in o) copy[k] = (o as Record<string, unknown>)[k] return copy as MinimatchOptions } ``` `cachedMinimatch()` (`src/index.ts:298-323`) then stores the `Minimatch` built from the poisoned `copyOptions(options)` under the key `optionsKey(options)` returns — the same key a later, option-less call will look up. Neither function has the one missing ch
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-141514
CVSS 3.7/10 · LOW · 01.12.2026
CWE: CWE-1321
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary
minimatch's module-global matcher cache can be poisoned by a __proto__ key in the options object passed to minimatch(). optionsKey() scores that key the same as no options at all, while copyOptions()'s bare for...in loop re-parents its copy onto the attacker's prototype instead of copying it as an own property — one caller doing this is enough to flip the cached match…
Affected: minimatch
⚡ ATTACK VECTOR
Network / Remote (AV:N) · no authentication required (PR:N) · no user interaction (UI:N).
🌍 REAL WORLD IMPACT
All confidential data readable/stealable; limited integrity modification (I:L).
🛡️ REMEDIATION
→ Apply vendor security update for minimatch.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.
⚠️ URGENCY
📌 Low priority — routine update sufficient.
────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]