CVE-2026-73562: Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)
Impact What kind of vulnerability is it? Who is impacted? Prototype pollution in update casting: passing a user-controlled update to a Mongoose update, like MyModel.updateOne(filter, req.body), can cause Mongoose to set $fullPath and $parentSchemaDocArray on Object.prototype. Example: Patches Has the problem been patched? What versions should users upgrade to? 9.7.2, 8.24.1.
Published Jul 24, 2026 · Updated Aug 13, 2026
Affected packages
mongoose
- Ecosystem
- npm
- Affected
- < 6.13.10
- Fixed in
- 6.13.10
- Check
npm ls mongoose
mongoose
- Ecosystem
- npm
- Affected
- >= 7.0.0, < 7.8.10
- Fixed in
- 7.8.10
- Check
npm ls mongoose
mongoose
- Ecosystem
- npm
- Affected
- >= 8.0.0, < 8.24.1
- Fixed in
- 8.24.1
- Check
npm ls mongoose
mongoose
- Ecosystem
- npm
- Affected
- >= 9.0.0, < 9.7.2
- Fixed in
- 9.7.2
- Check
npm ls mongoose
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
_What kind of vulnerability is it? Who is impacted?_
Prototype pollution in update casting: passing a user-controlled update to a Mongoose update, like MyModel.updateOne(filter, req.body), can cause Mongoose to set $fullPath and $parentSchemaDocArray on Object.prototype.
Example:
const mongoose = require('mongoose');
console.log('before:', Object.prototype.$fullPath); // undefined
const User = mongoose.model('User', new mongoose.Schema({ name: String }));
const malicious = JSON.parse('{"$set": {"__proto__.x": "anything"}}'); // attacker-controlled update
const q = User.updateOne({}, {});
try { q._castUpdate(malicious); } catch (e) { /* throws AFTER the pollution side-effect */ }
console.log('after :', Object.prototype.$fullPath); // "__proto__"
console.log('enumerable:', Object.prototype.propertyIsEnumerable('$fullPath')); // true
console.log('fresh {}:', ({}).$fullPath); // "__proto__"Patches
_Has the problem been patched? What versions should users upgrade to?_
9.7.2, 8.24.1. 7.8.10, 6.13.10
Workarounds
_Is there a way for users to fix or remediate the vulnerability without upgrading?_
Check user-controlled updates for own __proto__ properties before passing to Mongoose
References
_Are there any links users can visit to find out more?_
Credited to katzj.
References
- https://github.com/Automattic/mongoose/security/advisories/GHSA-664h-wqgq-64gw
- https://github.com/Automattic/mongoose/pull/16230
- https://github.com/Automattic/mongoose/commit/f494b8430f9097fc70446d6949c8a42a27518e0b
- https://github.com/Automattic/mongoose/releases/tag/6.13.10
- https://github.com/Automattic/mongoose/releases/tag/7.8.10
- https://github.com/Automattic/mongoose/releases/tag/8.24.1
- https://github.com/Automattic/mongoose/releases/tag/9.7.2
- https://github.com/advisories/GHSA-664h-wqgq-64gw
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-125116
Mongoose: Discriminator key values matching inherited properties (e.g. __t: 'constructor') bypass schema casting and can poison collections
medium4.8Nov 10, 2026CVE-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
high8.2Nov 10, 2026CVE-2026-125118
Mongoose: Prototype pollution via Schema.prototype.virtual()
medium6.5Nov 10, 2026CVE-2026-125119
Mongoose: Connection-level sanitizeFilter not applied
high7.5Nov 10, 2026CVE-2026-125120
Mongoose: sanitizeFilter not applied on countDocuments
critical9.8Nov 10, 2026CVE-2026-42334
Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection
high7.5May 5, 2026
