Skip to content

← Public intelligence

npm package

mongoose

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

9 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 6.5npmAmendedPublished

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

    CVE-2026-73562 · GHSA-664h-wqgq-64gw

    Affected
    • npm mongoose < 6.13.10; >= 7.0.0, < 7.8.10; >= 8.0.0, < 8.24.1; >= 9.0.0, < 9.7.2
    Fixed in
    8.24.17.8.109.7.26.13.10· Vendor fix available
    Issue
    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: 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?

    Recommended action: Upgrade to 9.7.2, 8.24.1, 7.8.10 or 6.13.10 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. High, CVSS 7.5npmAmendedPublished

    Mongoose's Improper Sanitization of $nor in sanitizeFilter May Allow NoSQL Injection

    CVE-2026-42334 · GHSA-wpg9-53fq-2r8h

    Affected
    • npm mongoose < 6.13.9; >= 7.0.0, <= 7.8.8; >= 8.0.0, <= 8.22.0; >= 9.0.0, <= 9.1.5
    Fixed in
    7.8.96.13.98.22.19.1.6· Vendor fix available
    Issue
    Impact This vulnerability allows bypassing Mongoose’s sanitizeFilter query sanitization mechanism via the $nor operator. When sanitizeFilter is enabled, Mongoose wraps query operators in $eq to neutralize them. However, prior to the fix, $nor was not included in the set of logical operators that are recursively sanitized. Because $nor accepts an array (like $and and $or), and arrays do not trigger hasDollarKeys(), malicious operators such as $ne, $gt, or $regex could be injected inside a $nor clause without being sanitized. This may lead to: - Authentication bypass - Unauthorized data access - Data exfiltration Affected users: Applications that: - Explicitly enable sanitizeFilter - Pass unsanitized user-controlled input directly into query methods (e.g., Model.findOne(req.body)) and rely on sanitizeFilter to strip out query selectors Applications that validate input schemas, whitelist fields, or avoid passing raw request bodies into queries are not affected. For example,…

    Recommended action: Upgrade to 9.1.6, 8.22.1, 7.8.9 or 6.13.9 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. Critical, CVSS 9.0npmAmendedPublished

    Mongoose search injection vulnerability

    CVE-2025-23061 · GHSA-vg7j-7cwx-8wgw

    Affected
    • npm mongoose >= 8.0.0-rc0, < 8.9.5; >= 7.0.0-rc0, < 7.8.4; < 6.13.6
    Fixed in
    6.13.68.9.57.8.4· Vendor fix available
    Issue
    Mongoose versions prior to 8.9.5, 7.8.4, and 6.13.6 are vulnerable to improper use of the $where operator. This vulnerability arises from the ability of the $where clause to execute arbitrary JavaScript code in MongoDB queries, potentially leading to code injection attacks and unauthorized access or manipulation of database data. NOTE: this issue exists because of an incomplete fix for CVE-2024-53900.

    Recommended action: Upgrade to 8.9.5, 7.8.4 or 6.13.6 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.7npmAmendedPublished

    Mongoose search injection vulnerability

    CVE-2024-53900 · GHSA-m7xq-9374-9rvx

    Affected
    • npm mongoose >= 8.0.0-rc0, < 8.8.3; >= 7.0.0-rc0, < 7.8.3; >= 6.0.0-rc0, < 6.13.5; >= 3.6.0-rc0, < 5.13.23
    Fixed in
    7.8.38.8.36.13.55.13.23· Vendor fix available
    Issue
    Mongoose versions prior to 8.8.3, 7.8.3, 6.13.5, and 5.13.23 are vulnerable to improper use of the $where operator. This vulnerability arises from the ability of the $where clause to execute arbitrary JavaScript code in MongoDB queries, potentially leading to code injection attacks and unauthorized access or manipulation of database data.

    Recommended action: Upgrade to 8.8.3, 7.8.3, 6.13.5 or 5.13.23 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. Critical, CVSS 10.0npmAmendedPublished

    Mongoose Prototype Pollution vulnerability

    CVE-2023-3696 · GHSA-9m93-w8w6-76hh

    Affected
    • npm mongoose >= 7.0.0, < 7.3.3; >= 6.0.0, < 6.11.3; < 5.13.20
    Fixed in
    5.13.207.3.36.11.3· Vendor fix available
    Issue
    Prototype Pollution in GitHub repository automattic/mongoose prior to 7.3.3, 6.11.3, and 5.13.20.

    Recommended action: Upgrade to 7.3.3, 6.11.3 or 5.13.20 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  6. Critical, CVSS 9.8npmAmendedPublished

    Mongoose Vulnerable to Prototype Pollution in Schema Object

    CVE-2022-24304 · GHSA-h8hf-x3f4-xwgp

    Affected
    • npm mongoose >= 6.0.0, < 6.4.6; < 5.13.15
    Fixed in
    5.13.156.4.6· Vendor fix available
    Issue
    Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Affected versions of this package are vulnerable to Prototype Pollution. The Schema.path() function is vulnerable to prototype pollution when setting the schema object. This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack. Proof of Concept Impact This vulnerability can be manipulated to exploit other types of attacks, such as Denial of service (DoS), Remote Code Execution, or Property Injection.

    Recommended action: Upgrade to 6.4.6 or 5.13.15 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  7. High, CVSS 7.0npmAmendedPublished

    automattic/mongoose vulnerable to Prototype pollution via Schema.path

    CVE-2022-2564 · GHSA-f825-f98c-gj3g

    Affected
    • npm mongoose >= 6.0.0, < 6.4.6; < 5.13.15
    Fixed in
    5.13.156.4.6· Vendor fix available
    Issue
    Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Affected versions of this package are vulnerable to Prototype Pollution. The Schema.path() function is vulnerable to prototype pollution when setting the schema object. This vulnerability allows modification of the Object prototype and could be manipulated into a Denial of Service (DoS) attack.

    Recommended action: Upgrade to 6.4.6 or 5.13.15 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  8. Medium, CVSS 5.1npmAmendedPublished

    Remote Memory Exposure in mongoose

    GHSA-r5xw-q988-826m

    Affected
    • npm mongoose >= 3.5.5, <= 3.8.38; >= 4.0.0, <= 4.3.5
    Fixed in
    4.3.63.8.39· Vendor fix available
    Issue
    Versions of mongoose before 4.3.6, 3.8.39 are vulnerable to remote memory exposure. Trying to save a number to a field of type Buffer on the affected mongoose versions allocates a chunk of uninitialized memory and stores it in the database. Recommendation Update to version 4.3.6, 3.8.39 or later.

    Recommended action: Upgrade to 4.3.6 or 3.8.39 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  9. Critical, CVSS 9.1npmAmendedPublished

    Improper Input Validation in Automattic Mongoose

    CVE-2019-17426 · GHSA-8687-vv9j-hgph

    Affected
    • npm mongoose >= 5.0.0, < 5.7.5; < 4.13.21
    Fixed in
    5.7.54.13.21· Vendor fix available
    Issue
    Automattic Mongoose through 5.7.4 allows attackers to bypass access control (in some applications) because any query object with a bsontype attribute is ignored. For example, adding "bsontype":"a" can sometimes interfere with a query filter. NOTE: this CVE is about Mongoose's failure to work around this bsontype special case that exists in older versions of the bson parser (aka the mongodb/js-bson project).

    Recommended action: Upgrade to 5.7.5 or 4.13.21 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →