GHSA-pcrw-h46h-c93h: Mongoose: sanitizeFilter not applied on countDocuments

Published Nov 9, 2026
·
Updated

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Prior to 6.13.11, 7.8.12, 8.24.3, and 9.9.2, Mongoose countDocuments() does not apply the configured sanitizeFilter query selector injection defense. An application that enables sanitizeFilter and passes attacker-controlled filter values to countDocuments() can therefore process query operator objects as operators rather than literal values, causing the count to include documents that should not match and potentially undermining authorization or application logic based on that count. This issue is fixed in versions 6.13.11, 7.8.12, 8.24.3, and 9.9.2.

Affected Software

1 affected component
npm/mongoose<6.13.11, <7.8.12, <8.24.3, <9.9.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 6.13.11
  2. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 7.8.12
  3. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 8.24.3
  4. Upgrade

    Upgrade Mongoose to a version that resolves this vulnerability.

    Fixed in 9.9.2

Event History

Nov 9, 2026
CVE Published
via OSV·10:36 PM
Data Sourced
via OSV·10:36 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications are affected if they use a Mongoose version earlier than 6.13.11, 7.8.12, 8.24.3, or 9.9.2, enable sanitizeFilter, and pass attacker-controlled filter values to countDocuments().

2

What must an attacker be able to do to exploit this?

An attacker needs to influence filter values supplied to countDocuments(). They can provide query operator objects that are processed as operators instead of literal values.

3

Does enabling sanitizeFilter prevent exploitation?

No. In affected versions, countDocuments() does not apply the configured sanitizeFilter defense, even when it is enabled.

4

What is the impact of a successful exploit?

The returned count can include documents that should not match the intended filter. This can undermine authorization decisions or other application logic that relies on the count.

5

What versions contain the fix?

The issue is fixed in Mongoose 6.13.11, 7.8.12, 8.24.3, and 9.9.2.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203