6.5medium
Mongoose: Prototype pollution in the update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.37% (higher than 32% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-664h-wqgq-64gwBIT-MONGOOSE-2026-73562
Description
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Prior to 6.13.10, 7.8.10, 8.24.1, and 9.7.2, passing a user-controlled update such as MyModel.updateOne(filter, req.body) can exploit Mongoose update casting with a __proto__.x dotted path under $set. Schema.prototype.path and Schema.prototype._getPathType can treat inherited properties of schema.paths and schema.nested as schema types, allowing the casting process to set $fullPath and $parentSchemaDocArray on Object.prototype before throwing. This prototype pollution makes those properties visible on newly created objects and can cause application integrity and availability impacts. This issue is fixed in versions 6.13.10, 7.8.10, 8.24.1, and 9.7.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Automattic mongoose | < 6.13.10, >= 7.0.0, < 7.8.10, >= 8.0.0, < 8.24.1, >= 9.0.0, < 9.7.2 | CVE List |
| mongoose (npm) | before 6.13.10, from 7.0.0 before 7.8.10, from 8.0.0 before 8.24.1, from 9.0.0 before 9.7.2 | GitHub Advisory Database |
| mongoose (Bitnami) | before 6.13.10, from 7.0.0 before 7.8.10, from 8.0.0 before 8.24.1, from 9.0.0 before 9.7.2 | Bitnami Vulnerability Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L |
| Bitnami Vulnerability Database | medium rating |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Prior to 6.13.10, 7.8.10, 8.24.1, and 9.7.2, passing a user-controlled update such as MyModel.updateOne(filter, req.body) can exploit Mongoose update casting with a __proto__.x dotted path under $set. Schema.prototype.path and Schema.prototype._getPathType can treat inherited properties of schema.paths and schema.nested as schema types, allowing the casting process to set $fullPath and $parentSchemaDocArray on Object.prototype before throwing. This prototype pollution makes those properties visible on newly created objects and can cause application integrity and availability impacts. This issue is fixed in versions 6.13.10, 7.8.10, 8.24.1, and 9.7.2.
GitHub Advisory Database
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?
NVD (es)
Mongoose es una herramienta de modelado de objetos de MongoDB diseñada para funcionar en un entorno asíncrono. Antes de las versiones 6.13.10, 7.8.10, 8.24.1 y 9.7.2, pasar una actualización controlada por el usuario, como MyModel.updateOne(filter, req.body), puede exploit el casting de actualización de Mongoose con una ruta punteada “__proto__.x” bajo $set. Schema.prototype.path y Schema.prototype._getPathType pueden tratar las propiedades heredadas de schema.paths y schema.nested como tipos de esquema, permitiendo que el proceso de casting establezca $fullPath y $parentSchemaDocArray en Object.prototype antes de lanzar una excepción. Esta contaminación de prototipos hace que esas propiedades sean visibles en objetos recién creados y puede causar impactos en la integridad y disponibilidad de la aplicación. Este problema está solucionado en las versiones 6.13.10, 7.8.10, 8.24.1 y 9.7.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-73562 changed 2026-08-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-664h-wqgq-64gw changed 2026-08-19 | CC-BY-4.0 |
| NVD | CVE-2026-73562 changed 2026-10-24 | Public domain |
| Bitnami Vulnerability Database | BIT-MONGOOSE-2026-73562 changed 2026-08-19 | Apache-2.0 |