CVE-2026-125116
Medium 4.8No known exploitationFix availableMongoose: Discriminator key values matching inherited properties (e.g. __t: 'constructor') bypass schema casting and can poison collections
Vendor advisory: GHSA-wr5m-5jph-8m96
Record last updated
CVSS score
Medium on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
Higher than 28% of scored CVEs. A prediction, not evidence.
CISA remediation deadline
Not in the KEV catalog
Description
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Prior to 6.13.12, 7.8.13, 8.24.7, and 9.11.4, Mongoose uses attacker-controlled discriminator key values, including the default __t field, to index plain-object registries such as Model.discriminators and schema.discriminators without requiring an own property. Values such as constructor, toString, or hasOwnProperty can therefore resolve to inherited built-in functions instead of a registered discriminator, causing type confusion in model construction, document creation, hydration, query and update casting, embedded discriminators, and populate operations. In the bulkWrite() insertOne path with skipValidation enabled, a constructor value can cause a raw input object to be stored without schema casting or strict filtering, and a stored poisoned document can make every query that hydrates it fail until the document is removed. The weakness reads inherited properties but does not modify Object.prototype and is not prototype pollution. This issue is fixed in versions 6.13.12, 7.8.13, 8.24.7, and 9.11.4.
Weakness: CWE-843
Patching and mitigation
- Patch status
- Fix available (source: GitHub Advisory Database)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- github.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Automattic | mongoose | < 6.13.12 | Not documented | CVE Program |
| Automattic | mongoose | >= 7.0.0, < 7.8.13 | Not documented | CVE Program |
| Automattic | mongoose | >= 8.0.0, < 8.24.7 | Not documented | CVE Program |
| Automattic | mongoose | >= 9.0.0, < 9.11.4 | Not documented | CVE Program |
| npm | mongoose | from 7.0.0 before 7.8.13 | 7.8.13 | GitHub Advisory Database |
| npm | mongoose | from 8.0.0 before 8.24.7 | 8.24.7 | GitHub Advisory Database |
| npm | mongoose | from 9.0.0 before 9.11.4 | 9.11.4 | GitHub Advisory Database |
| npm | mongoose | all versions before 6.13.12 | 6.13.12 | GitHub Advisory Database |
Timeline
Disclosure
CVE record published by GitHub_M
Source: CVE Program (opens in a new tab)
Patch
Fix documented by GitHub Advisory Database
Vendor guidance and references
- https://github.com/Automattic/mongoose/commit/0ecd8040d9b446f36535d79938c130c800f91766 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/commit/18afab75bea861f625b7c5b54635c84567ec566c (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/commit/390453c8ce1b36b6cfd1e63432a910da1f3d81d5 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/commit/8cee51beead554df1f3d05645edb439c69eb2a9b (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/commit/b26c43554233134ea978c5852babe13be858b2cf (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/commit/b68f90734b50cd22c89a669c8ca1469d7234b296 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/releases/tag/6.13.12 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/releases/tag/7.8.13 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/releases/tag/8.24.7 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/releases/tag/9.11.4 (opens in a new tab)x_refsource_misc
- https://github.com/Automattic/mongoose/security/advisories/GHSA-wr5m-5jph-8m96 (opens in a new tab)x_refsource_confirm
- GitHub Advisory GHSA-wr5m-5jph-8m96 (opens in a new tab)github-advisory