Home › Vulnerabilities › Automattic
Mongoose batch fixes a critical filter-injection flaw and four prototype and discriminator weaknesses
NVD published five Mongoose advisories on 2026-11-09. The most serious, CVE-2026-125120 (CVSS 9.8), lets operator objects bypass the sanitizeFilter defense in countDocuments(), and the others cover query sanitization gaps, prototype-related writes, and discriminator key confusion.
What to look into
- 5 vulnerabilities in Automattic mongoose: 1 critical, 2 high, 2 medium (CVSS up to 9.8).
- None of them is known to be exploited yet.
- Start with CVE-2026-125120 (9.8 critical): Mongoose countDocuments() bypasses sanitizeFilter, allowing query operator injection into counts (CVE-2026-125120). An attacker without an account can exploit this over the network, without any user action.
- 5 of 5 can be attacked over the network without logging in, 5 of them without anyone clicking anything.
- Kinds of flaws: Improper Neutralization of Special Elements in Data Query Logic (×2); Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (×2); Access of Resource Using Incompatible Type ('Type Confusion').
Key points
- CVE-2026-125120 (CVSS 9.8) is the critical issue: countDocuments() ignores sanitizeFilter, so operator objects are processed as operators.
- CVE-2026-125119 and CVE-2026-125120 both weaken query-filter sanitization, with different scopes.
- CVE-2026-125117 and CVE-2026-125118 can overwrite shared built-in or prototype properties, potentially disrupting other models or spoofing checks.
- CVE-2026-125116 is type confusion via discriminator keys rather than prototype pollution.
- No record states that any of these issues is known to be exploited.
Mongoose is an object modeling library for MongoDB that is designed for asynchronous Node.js code. This batch of five advisories, published by NVD on 2026-11-09, covers one critical, two high, and two medium issues in query handling, object merging, virtual schema paths, and discriminator lookup.
Query filter injection
The most severe record is CVE-2026-125120 (CVSS 9.8, critical). When sanitizeFilter is enabled, countDocuments() does not apply it, so attacker-supplied query operator objects are treated as operators. The resulting count can include documents that should not match, which can undermine authorization or logic based on that count.
CVE-2026-125119 (CVSS 7.5, high) is a related gap. A connection-level sanitizeFilter setting from mongoose.connect() or createConnection() is stored but not read during query casting, so the connection appears protected while selector objects pass through. A crafted password value can match an account record without the expected literal password. Global configuration and per-query settings are not affected.
Prototype-related writes
CVE-2026-125117 (CVSS 8.2, high) involves keys such as toString or valueOf that reach shared built-in functions during document loading, dotted-path updates, and merges. An overwritten built-in can break queries on unrelated models until the process restarts. A separate path through strict: false subdocuments can reach $schema and alter shared validators or schema options.
CVE-2026-125118 (CVSS 6.5, medium) allows path segments such as proto or constructor in virtual field names to write enumerable properties onto Object.prototype or Function.prototype. The advisory notes this could spoof inherited authorization flags.
Discriminator key confusion
CVE-2026-125116 (CVSS 4.8, medium) uses discriminator key values to index plain-object registries without an own-property check. Inherited built-in functions can then be selected in place of registered discriminators, causing type confusion. With bulkWrite() insertOne and skipValidation enabled, a constructor value can store an unvalidated object, and that document can make queries that hydrate it fail until it is removed. The record states this does not modify Object.prototype.
None of the records state that these flaws are known to be exploited.
What to do
- Upgrade to the fixed release for your branch: 6.13.12, 7.8.13, 8.24.7, or 9.11.4, and prefer the newest patch level available.
- Review every countDocuments() call that receives user-supplied filters, and do not rely on it for authorization decisions until upgraded.
- Check whether sanitizeFilter is set only at connection level, and verify that login and other sensitive lookups use per-query or validated input.
- Restrict user control over virtual field names, dynamic schemas, and discriminator keys, and review the full advisory text for CVE-2026-125117 because the feed record is truncated.
The 5 vulnerabilities
- CVE-2026-125120 9.8 Mongoose countDocuments() bypasses sanitizeFilter, allowing query operator injection into counts (CVE-2026-125120)
- CVE-2026-125117 8.2 CVE-2026-125117: Mongoose flaw lets crafted input overwrite shared objects; fixed in four branches
- CVE-2026-125119 7.5 Mongoose CVE-2026-125119: connection-level sanitizeFilter not applied to queries, enabling account matches without the real password
- CVE-2026-125118 6.5 Mongoose prototype pollution via unvalidated virtual field paths (CVE-2026-125118)
- CVE-2026-125116 4.8 Mongoose CVE-2026-125116: attacker-controlled discriminator keys cause type confusion and can poison documents
Frequently asked questions
How many Automattic mongoose vulnerabilities were published on November 9, 2026?
5 vulnerabilities: 1 critical, 2 high, 2 medium, with CVSS scores up to 9.8.
Are any of them being exploited?
None of them is in CISA's Known Exploited Vulnerabilities catalog yet.
Which one should be fixed first?
CVE-2026-125120 (CVSS 9.8): Mongoose countDocuments() bypasses sanitizeFilter, allowing query operator injection into counts (CVE-2026-125120).