All vulnerabilities

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.
From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
mongoosenpm · osv:npm:mongoose
  • Every version before 6.13.12
  • From 7.0.0 before 7.8.13
  • From 8.0.0 before 8.24.7
  • From 9.0.0 before 9.11.4

About mongoose

Weekly downloads (npm)
9,379,180npm, 24 Nov 2026

References