Urgent
mongoose countDocuments() skips filter sanitizing, miscounting documents
CVE-2026-125120
Document counts in a MongoDB connection tool can be manipulated!
- CVE
- CVE-2026-125120 (opens in a new tab)
- Score
- CVSS 9.8
- First seen
9.8
Products
Mitigation
Update to 6.13.11, 7.8.12, 8.24.3 or 9.9.2, matching the major version you use.
Fixed version by product
- Automattic Mongoose 6
- 6.13.11 or later
- Automattic Mongoose 7
- 7.8.12 or later
- Automattic Mongoose 8
- 8.24.3 or later
- Automattic Mongoose 9
- 9.9.2 or later
Summary
mongoose's countDocuments() does not apply the sanitizeFilter defense, so attacker-supplied filter values can be processed as query operators. Apps that enable sanitizeFilter and pass attacker-controlled filters to this function are affected.
Affected when
- sanitizeFilter option enabled
- attacker-controlled filter values passed to countDocuments()
4 other Incidents of this product in the last 30 days
Incidents by product: Automattic mongoose
Other recent Incidents of Automattic mongoose
Read the advisory · github.com (opens in a new tab)
- Advisory: github.com (opens in a new tab)
- CVE record: cve.org (opens in a new tab)