CVE-2026-125118: Mongoose: Prototype pollution via Schema.prototype.virtual()
Published 2026-11-10 · Updated 2026-11-27 · Also known as BIT-mongoose-2026-125118, GHSA-6972-9mcm-vhwj
Summary
Mongoose contains a prototype pollution vulnerability via Schema.prototype.virtual() due to missing special property checks on parsed path segments. All engineering teams utilizing dynamic schema definitions or untrusted input for Mongoose virtuals must update their dependencies.
Who is affected
Affected deployments are those where attacker-influenced schema field names are passed to Schema.prototype.virtual(), such as in dynamic schemas, CMS form builders, or schema-as-code scenarios. This allows pollution of Object.prototype and Function.prototype, potentially enabling property spoofing or leveraging function prototype gadgets.
Exploitability
The vulnerability has a CVSS 3.1 base score of 6.5 (Medium) with a vector indicating network attack vector, low complexity, and no privileges or user interaction required. The EPSS score is 0.006, and CISA Known Exploited Vulnerabilities status is no.
Remediation
- Upgrade npm package mongoose to version 6.13.12 or higher
- Upgrade npm package mongoose to version 7.8.13 or higher
- Upgrade npm package mongoose to version 8.24.7 or higher
- Upgrade npm package mongoose to version 9.11.4 or higher
How to check your project
- Check project package.json or lockfiles for mongoose versions matching introduced 0 fixed 6.13.12, introduced 7.0.0 fixed 7.8.13, introduced 8.0.0 fixed 8.24.7, or introduced 9.0.0 fixed 9.11.4
Automated analysis of the published advisory data, generated 2026-11-27. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| npm | mongoose |
>= 0, < 6.13.12 | 6.13.12 | npm install [email protected] |
| npm | mongoose |
>= 7.0.0, < 7.8.13 | 7.8.13 | npm install [email protected] |
| npm | mongoose |
>= 8.0.0, < 8.24.7 | 8.24.7 | npm install [email protected] |
| npm | mongoose |
>= 9.0.0, < 9.11.4 | 9.11.4 | npm install [email protected] |
CVSS 3.1 vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Privileges required | None |
| User interaction | None |
| Scope | Unchanged |
| Confidentiality | None |
| Integrity | Low |
| Availability | Low |
FAQ
What causes the vulnerability in Mongoose?
Schema.prototype.virtual() fails to check for special properties like __proto__, constructor, and prototype when processing path segments, unlike path() and add() methods.
Is this vulnerability actively exploited in the wild?
No, CISA Known Exploited Vulnerabilities status is no.
What components of JavaScript are impacted by the pollution?
Object.prototype and Function.prototype can be polluted, introducing enumerable keys visible on every object or leveraging Function.prototype gadgets.
Original advisory description
References
- WEB https://github.com/Automattic/mongoose/security/advisories/GHSA-6972-9mcm-vhwj
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-125118
- WEB https://github.com/Automattic/mongoose/commit/318f7e09dd363a1dfddb8180878488dccd2796d1
- WEB https://github.com/Automattic/mongoose/commit/74df7769b5a8d89c4413b764029911ee915ea467
- WEB https://github.com/Automattic/mongoose/commit/7a2a6567abbb72c0430c8cc5b7942141844fecff
- WEB https://github.com/Automattic/mongoose/commit/fb467e6d33174293dc0360649f20ce68d99117a9
- PACKAGE https://github.com/Automattic/mongoose
- WEB https://github.com/Automattic/mongoose/releases/tag/6.13.12
- WEB https://github.com/Automattic/mongoose/releases/tag/7.8.13
- WEB https://github.com/Automattic/mongoose/releases/tag/8.24.7
- WEB https://github.com/Automattic/mongoose/releases/tag/9.11.4
Source records: GHSA-6972-9mcm-vhwj (OSV.dev) · EPSS by FIRST, 2026-11-27.