CVE-2026-125120
Mongoose: sanitizeFilter not applied on countDocuments
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used 9.8
Mongoose: sanitizeFilter not applied on countDocuments
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.
- Record
CVE-2026-125120- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-943
- Updated
- 2026-11-09
EUVDEUVD-2026-120503 9.8
Mongoose: sanitizeFilter not applied on countDocuments
- Record
EUVD-2026-120503- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Updated
- 2026-11-10
GitHub AdvisoriesGHSA-pcrw-h46h-c93h 9.8
Mongoose: sanitizeFilter not applied on countDocuments
Impact
sanitizeFilter is Mongoose's mechanism for protecting against query selector injection attacks. In older versions of Mongoose, sanitizeFilter was not applied for countDocuments() queries.
Patches
Patches have been released for all supported Mongoose major release lines. Please upgrade to the following versions depending on which major version of Mongoose applications are using.
^9.9.2^8.24.3^7.8.12^6.13.11
Workarounds
Middleware:
mongoose.plugin(function() {
schema.pre('countDocuments', function() {
// This will always apply `sanitizeFilter` on `countDocuments`
mongoose.sanitizeFilter(this.getFilter());
});
});
- Record
GHSA-pcrw-h46h-c93h- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-943
- Updated
- 2026-11-10
NVD 9.8
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.
- Record
CVE-2026-125120- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-943
- Updated
- 2026-11-10
OSV 9.8
Mongoose: sanitizeFilter not applied on countDocuments
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.
- Record
CVE-2026-125120- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-943
- Updated
- 2026-11-11
OSVGHSA-pcrw-h46h-c93h 9.8
Mongoose: sanitizeFilter not applied on countDocuments
Impact
sanitizeFilter is Mongoose's mechanism for protecting against query selector injection attacks. In older versions of Mongoose, sanitizeFilter was not applied for countDocuments() queries.
Patches
Patches have been released for all supported Mongoose major release lines. Please upgrade to the following versions depending on which major version of Mongoose applications are using.
^9.9.2^8.24.3^7.8.12^6.13.11
Workarounds
Middleware:
mongoose.plugin(function() {
schema.pre('countDocuments', function() {
// This will always apply `sanitizeFilter` on `countDocuments`
mongoose.sanitizeFilter(this.getFilter());
});
});
- Record
GHSA-pcrw-h46h-c93h- CVSS 3.1
- 9.8 Critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-943
- Updated
- 2026-11-10
OSVCLSA-2026-1794390937No score
TuxCare security update for mongoose (2 CVEs)
TuxCare rebuilt mongoose to address 2 CVEs. Fixed in 6.12.2-tuxcare.6.
- Record
CLSA-2026-1794390937- Updated
- 2026-11-11
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
mongoosenpm | before 6.13.11 | 6.13.11 |
mongoosenpm | 7.0.0 up to 7.8.12 | 7.8.12 |
mongoosenpm | 8.0.0 up to 8.24.3 | 8.24.3 |
mongoosenpm | 9.0.0 up to 9.9.2 | 9.9.2 |
mongooseTuxCare:npm From an advisory covering 2 CVEs | 6.12.2-tuxcare.0 up to 6.12.2-tuxcare.6, plus listed versions 6.12.26.12.2-tuxcare.16.12.2-tuxcare.26.12.2-tuxcare.36.12.2-tuxcare.46.12.2-tuxcare.5 | 6.12.2-tuxcare.6 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases | OSV | |
| published | EUVD | |
| affected, references | OSV | |
| affected, facts, references | GitHub Advisories | |
| aliases, references | NVD, OSV | |
| cwes, references, severity, title | CVE List | |
| first indexed | EUVD |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-125120 is a critical vulnerability (CVSS 9.8) in Automattic Mongoose, published November 9, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.57%, the 47th percentile. Fixed in mongoose 6.13.11.
References
github.com/Automattic/mongoose/security/advisories/GHSA-pcrw-h46h-c93h
github.com/Automattic/mongoose/commit/7e912af3fac52cb0eea4cd71e24d65318916831a
github.com/Automattic/mongoose/commit/8b10d5760bb181f5bf5d01495cde161c8aed0557
github.com/Automattic/mongoose/commit/b1df045aab076b740fdaec14a15a44c694b85b7d
github.com/Automattic/mongoose/commit/b5003d3915db1cf9209c38a4b93cf3a92cddd710
github.com/Automattic/mongoose/releases/tag/6.13.11
Show 7 moreShow less
github.com/Automattic/mongoose/releases/tag/7.8.12
github.com/Automattic/mongoose/releases/tag/8.24.3
github.com/Automattic/mongoose/releases/tag/9.9.2
nvd.nist.gov/vuln/detail/CVE-2026-125120
github.com/advisories/GHSA-pcrw-h46h-c93h
github.com/CVEProject/cvelistV5/tree/main/cves/2026/125xxx/CVE-2026-125120.json
github.com/Automattic/mongoose