Patchfirst
CVE-2026-125120 Critical · 9.8 EPSS 0.6%

Mongoose: sanitizeFilter not applied on countDocuments

Fix:upgrade mongoose to 9.9.2 or later Details ↓

Automattic · mongoose

Summary

In Mongoose, the countDocuments() method fails to apply the sanitizeFilter query selector injection defense, so a configured sanitizeFilter has no effect on that method. An attacker who can supply filter values to an application that calls countDocuments() with them, without needing any credentials, can get query operator objects treated as operators rather than literal values, which can inflate the count and undermine authorization or logic that depends on it.

Official description · NVD

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.

Breakdown
18.6 / 100
Exploited
Not confirmed
Reports
0
Tactics
0/15

Disclosed on 9 Nov 2026. No public exploit code or confirmed exploitation is recorded.

7 fixes in mongoose over 22 months. The latest fix listed for mongoose is 9.11.4.

Fixes in mongoosenpm package, by fixed version. Earlier and later fixes in the same package, not necessarily the same bug.

  1. 8.9.5CVE-2025-2306115 Jan 2025
  2. 9.1.6CVE-2026-4233414 May 2026
  3. 9.7.2CVE-2026-7356213 Aug 2026
  4. 9.9.2CVE-2026-1251209 Nov 2026
  5. 9.11.4CVE-2026-1251169 Nov 2026
  6. 9.11.4CVE-2026-1251179 Nov 2026
  7. 9.11.4CVE-2026-1251189 Nov 2026Latest listed

Affected versions and fixes

as published in the CVE record

Automattic mongoose

Affected: < 6.13.11 · >= 7.0.0, < 7.8.12 · >= 8.0.0, < 8.24.3 · >= 9.0.0, < 9.9.2

Am I affected? What do I upgrade to?

From GitHub Security Advisories and OSV

1 package in 1 ecosystem. Main package: mongoose.

Upgrade to 9.9.2 or later

npmnpm install mongoose@9.9.2

The first fix for CVE-2026-125120.

Affected versions, by release line

If you runUpgrade to
9.0.0 up to 9.9.29.9.2
8.0.0 up to 8.24.38.24.3
7.0.0 up to 7.8.127.8.12
All versions before 6.13.116.13.11

“Up to” means the second version is the fix and is not affected.

Check your lockfile against all CVEs

What security researchers reported

Not named in any threat report yet

Also mentioned in 8 community threat pulses (AlienVault OTX)

Weaker evidence

Pulses are indicator collections that anyone can publish. A mention is not confirmation of exploitation.

References

9 links, grouped by NVD tag
↑ ↓ chooseEnter openEsc close