CVE-2026-73562: Mongoose Prototype Pollution Vulnerability

MODERATE
Advisory Identifier: GHSA-664h-wqgq-64gw
CVSS 6.5
CWE-1321
Published
Advisory Summary

CVE-2026-73562 is a MODERATE (CVSS 6.5) prototype pollution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Mongoose libraries in the npm ecosystem. The issue involves prototype pollution in mongoose update casting via __proto__-prefixed dotted path (schema._getschema/path getter). Remediation is available by upgrading affected packages to version 6.13.10, 7.8.10, 8.24.1, 9.7.2.

CVE-2026-73562 at a Glance

CVE Identifier CVE-2026-73562
GHSA Identifier GHSA-664h-wqgq-64gw
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Mongoose
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2026-73562

To remediate this vulnerability, upgrade all affected Mongoose dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mongoose fixed: 6.13.10
npm install mongoose@6.13.10
mongoose fixed: 7.8.10
npm install mongoose@7.8.10
mongoose fixed: 8.24.1
npm install mongoose@8.24.1
mongoose fixed: 9.7.2
npm install mongoose@9.7.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls mongoose

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-73562, inspect your project dependencies using npm:

npm ls mongoose

Analyze the terminal output to locate any version of Mongoose in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 6.13.10), your application is affected.

Note: The npm ls mongoose command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Mongoose, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-73562 Affected Mongoose Versions

4 component(s)
Fixed Versions:
6.13.107.8.108.24.19.7.2
Product / Package Ecosystem Affected Versions Fixed Version
mongoose
npm
< 6.13.10
6.13.10
mongoose
npm
≥ 7.0.0
< 7.8.10
7.8.10
mongoose
npm
≥ 8.0.0
< 8.24.1
8.24.1
mongoose
npm
≥ 9.0.0
< 9.7.2
9.7.2

References

Frequently Asked Questions

What is CVE-2026-73562?
CVE-2026-73562 is a security vulnerability in Mongoose involving Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter) under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Mongoose versions are affected?
Affected versions include releases prior to 6.13.10, 7.8.10, 8.24.1, 9.7.2 across affected packages: mongoose.
What version fixes CVE-2026-73562?
Upgrading to 6.13.10, 7.8.10, 8.24.1, 9.7.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongoose affected?
Yes, mongoose is affected in releases prior to 6.13.10, 7.8.10, 8.24.1, 9.7.2. Upgrade your dependency to 6.13.10, 7.8.10, 8.24.1, 9.7.2 or later.
What is the CVSS score of CVE-2026-73562?
CVE-2026-73562 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L.
What CWE is associated with CVE-2026-73562?
CVE-2026-73562 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2026-73562?
Run the dependency tree command: 'npm ls mongoose'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-664h-wqgq-64gw",
  "modified" : "2026-08-13T17:27:25Z",
  "published" : "2026-07-24T16:22:34Z",
  "aliases" : [ "CVE-2026-73562" ],
  "summary" : "Mongoose: Prototype pollution in mongoose update casting via __proto__-prefixed dotted path (Schema._getSchema/path getter)",
  "details" : "### Impact\n_What kind of vulnerability is it? Who is impacted?_\n\nPrototype 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`.\n\nExample:\n\n```javascript\nconst mongoose = require('mongoose');\nconsole.log('before:', Object.prototype.$fullPath);            // undefined\n\nconst User = mongoose.model('User', new mongoose.Schema({ name: String }));\nconst malicious = JSON.parse('{\"$set\": {\"__proto__.x\": \"anything\"}}');   // attacker-controlled update\n\nconst q = User.updateOne({}, {});\ntry { q._castUpdate(malicious); } catch (e) { /* throws AFTER the pollution side-effect */ }\n\nconsole.log('after :', Object.prototype.$fullPath);            // \"__proto__\"\nconsole.log('enumerable:', Object.prototype.propertyIsEnumerable('$fullPath'));  // true\nconsole.log('fresh {}:', ({}).$fullPath);                      // \"__proto__\"\n```\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_\n\n9.7.2, 8.24.1. 7.8.10, 6.13.10\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\nCheck user-controlled updates for own `__proto__` properties before passing to Mongoose\n\n### References\n_Are there any links users can visit to find out more?_",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongoose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.13.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongoose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.8.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongoose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "8.24.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongoose"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "9.0.0"
      }, {
        "fixed" : "9.7.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/security/advisories/GHSA-664h-wqgq-64gw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/pull/16230"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/commit/f494b8430f9097fc70446d6949c8a42a27518e0b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Automattic/mongoose"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/releases/tag/6.13.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/releases/tag/7.8.10"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/releases/tag/8.24.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Automattic/mongoose/releases/tag/9.7.2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T16:22:34Z",
    "nvd_published_at" : null
  }
}