CVE Professor
/
All CVEs
CVE-2026-142595

CVE-2026-142595 — Mongoose — CWE-943

MEDIUM CVSS 6.5 ⚡ EPSS 0.8% GitHub

### Summary Mongoose's `sanitizeFilter` option is meant to block query selector injection. Before this fix, it only refused four top-level operators by name: `$jsonSchema`, `$where`, `$expr` and `$text`. Any other top-level `$` operator was passed to MongoDB unchanged. That includes undocumented internal operators like `$_internalSchemaXor` and `$_internalSchemaCond`, which take sub-filters, and `sanitizeFilter` never inspected those sub-filters. An attacker who controls the keys of a query filter could use them to slip arbitrary query selectors like `$ne` or `$regex` past `sanitizeFilter`. ### Details With `sanitizeFilter` enabled, Mongoose: - wraps any object value containing `$` keys in `$eq`, so `{ password: { $ne: null } }` becomes `{ password: { $eq: { $ne: null } } }`; - recurses into `$and`, `$or` and `$nor`; - throws on `$jsonSchema`, `$where`, `$expr` and `$text` unless the value is wrapped in `mongoose.trusted()`. Every other top-level key starting with `$` was left alone. MongoDB accepts several internal match expressions at the top level that contain nested filters, for example: - `$_internalSchemaXor: [filter1, filter2]` - `$_internalSchemaCond: [ifFilter, thenFilter, elseFilter]` Because `sanitizeFilter` doesn't recurse into these, the nested filters can contain any query selector. The fix makes `sanitizeFilter` refuse every top-level key that starts with `$`, except `$and`, `$or` and `$nor`, which it recurses into, and values wrapped in `mongoose.trust

### Summary Mongoose's `sanitizeFilter` option is meant to block query selector injection. Before this fix, it only refused four top-level operators by name: `$jsonSchema`, `$where`, `$expr` and `$text`. Any other top-level `$` operator was passed to MongoDB unchanged. That includes undocumented internal operators like `$_internalSchemaXor` and `$_internalSchemaCond`, which take sub-filters, and `sanitizeFilter` never inspected those sub-filters. An attacker who controls the keys of a query filter could use them to slip arbitrary query selectors like `$ne` or `$regex` past `sanitizeFilter`. ### Details With `sanitizeFilter` enabled, Mongoose: - wraps any object value containing `$` keys in `$eq`, so `{ password: { $ne: null } }` becomes `{ password: { $eq: { $ne: null } } }`; - recurses into `$and`, `$or` and `$nor`; - throws on `$jsonSchema`, `$where`, `$expr` and `$text` unless the value is wrapped in `mongoose.trusted()`. Every other top-level key starting with `$` was left alone. MongoDB accepts several internal match expressions at the top level that contain nested filters, for example: - `$_internalSchemaXor: [filter1, filter2]` - `$_internalSchemaCond: [ifFilter, thenFilter, elseFilter]` Because `sanitizeFilter` doesn't recurse into these, the nested filters can contain any query selector. The fix makes `sanitizeFilter` refuse every top-level key that starts with `$`, except `$and`, `$or` and `$nor`, which it recurses into, and values wrapped in `mongoose.trust

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
Attack Vector Network AV:N
Attack Complexity High AC:H
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality High C:H
Integrity Low I:L
Availability None A:N
EPSS — Exploit Prediction Scoring System
0.8%
30-day probability
In the 59. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
CVE-2026-142595
CVSS 6.5/10 · MEDIUM · 02.12.2026
CWE: CWE-943
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:L/A:N
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

🎯 WHAT IS THIS VULNERABILITY?
Summary: ### Summary

Mongoose's sanitizeFilter option is meant to block query selector injection. Before this fix, it only refused four top-level operators by name: $jsonSchema, $where, $expr and $text. Any other top-level $ operator was passed to MongoDB unchanged.
Affected: mongoose

⚡ 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 mongoose.
→ Pre-patch: put service behind VPN or apply IP allowlist.
→ Add WAF rule, create IDS alert for anomalous traffic.

⚠️ URGENCY
📋 Routine update cycle (30 days)

────────────────────────────────────────
[Automated Technical Vulnerability & CVSS Vector Analysis]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="MongoDB"
CVSS Score
6.5 / 10 · CVSS MEDIUM
Weakness Types (CWE)
CWE-943
Affected Products (1)
mongoose
References & Advisories (4)
Related CVEs
5.3
CVE-2026-144571
Payload 3.86.0 before 3.94.2 and 4.0.0-beta.1 before 4.0.0-beta.12 contains an access control bypass in the Mo
9.2
CVE-2026-145153
LangChain4j before 1.5.4-beta11, 1.11.12-beta19, 1.19.4-beta29, and 1.23.0-beta33 contains an injection vulner
8.9
CVE-2026-144591
PhpSpreadsheet through 5.12.0 contains a server-side request forgery vulnerability that allows attackers to re
8.5
CVE-2026-120096
Missing authorization in the push publishing endpoints REST API (/api/v1/environments/endpoints) and in the pu
8.2
CVE-2026-144617
Traccar 6.13.0 before 6.18.0 contains a denial of service vulnerability that allows remote attackers knowing a
8.2
CVE-2026-144623
Micronaut core HTTP client 4.10.24 through 4.10.37 and 5.0.1 through 5.3.0 contains a credential leak vulnerab
8.2
CVE-2026-144684
postcss-selector-parser before 6.1.6 and 7.x before 7.1.8 contains a denial of service vulnerability that allo