CVE-2026-125120: 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 MITRE·10:36 PM
Data Sourced
via MITRE·10:36 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications are exposed if they enable Mongoose's sanitizeFilter option and pass attacker-controlled filter values to countDocuments(). The issue affects Mongoose versions before 6.13.11, 7.8.12, 8.24.3, and 9.9.2.

2

What does an attacker need to exploit it?

An attacker needs a way to supply filter values used by the application's countDocuments() call. Crafted query operator objects can then be interpreted as MongoDB operators instead of literal values.

3

What is the practical impact?

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.

4

How can this be remediated?

Upgrade Mongoose to 6.13.11, 7.8.12, 8.24.3, 9.9.2, or a later version in the applicable release line.

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