npm
CVE-2026-125117
Mongoose walks into inherited properties when hydrating, setting, and merging, allowing overwrites of built-in functions (denial of service) and shared schema state
- Severity
- High 8.2
- Published
- 10 Nov 2026
- Last changed
- 10 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 6.13.12, 7.8.13, 8.24.7, 9.11.4
- Exploit chance
- 0.6% in the next 30 daysHigher than 48% of CVEs. EPSS by FIRST, 24 Nov 2026
- Weakness
- Prototype pollution (CWE-1321)
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Change some data · Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H- Also known as
- GHSA-8332-j7wj-wjw4
- Sources
- OSV.dev and GitHub
Description
Three Mongoose code paths copy data into objects by property name without checking whether the property is the object's own or inherited from its prototype:
- Loading a document from the database (init(), also used by Model.hydrate())
- Setting a dotted path on a document ($__set, used by new Model(obj), doc.set() and doc.$set())
- Merging update documents (utils.mergeClone, used by findOneAndReplace(), chained update calls and Query.prototype.merge())
When a key names an inherited property, such as toString or valueOf, or a document internal such as $__schema, Mongoose writes into the shared object behind that property. The data comes from the attacker.
- Denial of service. For example, { "toString": { "call": 1 } } overwrites Object.prototype.toString.call. Mongoose and most other libraries rely on Object.prototype.toString.call(). After the overwrite, every later query in the process throws TypeError: _toString.call is not a function until the process restarts.
Affected software
| Software | Affected versions |
|---|---|
mongoosenpm · osv:npm:mongoose |
|
About mongoose
- Weekly downloads (npm)
- 9,379,180npm, 24 Nov 2026
Vulnerabilities in mongoose
- In our list
- 5
- Published in the last 12 months
- 5
- Critical, last 12 months
- 1
- High, last 12 months
- 2
- Known exploited
- 0
- CVE-2026-125116Mongoose: Discriminator key values matching inherited properties (e.g. __t: 'constructor') bypass schema casting and can poison collectionsMedium 4.8 10 Nov 2026
- CVE-2026-125118Mongoose: Prototype pollution via Schema.prototype.virtual()Medium 6.5 10 Nov 2026
- CVE-2026-125119Mongoose: Connection-level sanitizeFilter not appliedHigh 7.5 10 Nov 2026
- CVE-2026-125120Mongoose: sanitizeFilter not applied on countDocumentsCritical 9.8 10 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-125117
- GitHub Advisory Database https://github.com/advisories/GHSA-8332-j7wj-wjw4