HIGHCVSS v3.1 8.2Vulnerability

CVE-2026-125117

### Summary 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: 1. Loading a document from the database (`init()`, also used by `Model.hydrate()`) 2. Setting a dotted path on a document (`$__set`, used by `new Model(obj)`, `doc.set()` and `doc.$set()`) 3. 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. This includes queries on unrelated models. - **Changing shared schema state.** Through a subdocument with `strict: false`, a path such as `profile.$__schema.paths.email.validators` reaches the subdocument's schema, which every document shares. Setting it to `[]` removes the `required` validator for every document in the process. Mongoose already blocked `__proto__`, `constructor` and `prototype`, so these bugs cannot add properties to `Object.prototype` itself. They can still overwrite methods and properties of shared built-in functions and of Mongoose's internal objects. ### Details #### 1. Loading documents: `init()` ```js if (!schemaType && utils.isPOJO(value)) { // assume nested object if (!doc[i]) { doc[i] = {}; ... } init(self, value, doc[i], opts, path + '.'); } ``` For a stored field named `toString`, `doc[i]` is the inherited `Object.prototype.toString`. It is truthy, so `init()` recurses into that function and copies the stored sub

Properties

Summary
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
Nvd fetched at
2026-11-10T23:33:48.924589+00:00
Epss score
0.00584
Cvss score
8.2
Cvss severity
HIGH
Retrieved at
2026-11-10T23:35:17+00:00
Ghsa published
2026-11-10T20:56:16Z
Source url
https://github.com/advisories/GHSA-8332-j7wj-wjw4
Ghsa updated
2026-11-10T20:56:18Z
Ghsa id
GHSA-8332-j7wj-wjw4
Last source
FIRST EPSS
Score
8.2
Cvss version
3.1
Cve id
CVE-2026-125117
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
First seen by Signal
2026-11-10T03:20:43+00:00
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Published at
2026-11-09T23:17:22.080

Related Entities (3)

AFFECTS (1)

→[Software]npm/mongoose

VULNERABLE_TO (1)

←[Software]npm/mongoose

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-125117 (CVSS v3.1 8.2) — Ninja Signal Threat Intelligence | Ninja Signal