Mongoose: sanitizeFilter not applied on countDocuments
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
Mongoose versions before 6.13.11, from 7.0.0 before 7.8.12, from 8.0.0 before 8.24.3, and from 9.0.0 before 9.9.2 do not apply the sanitizeFilter query selector injection defense in countDocuments(), a missing neutralization of special elements in data query logic (CWE-943). An unauthenticated remote attacker can submit query operator objects in filter values that are processed as operators rather than literal values, so the count includes documents that should not match. This can undermine authorization or application logic that depends on that count. The issue requires an application that enables sanitizeFilter and passes attacker-controlled filter values to countDocuments().
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the CNA
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- None
- Automatable
- No
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| Automattic | mongoose | before 6.13.11; 7.0.0 to before 7.8.12; 8.0.0 to before 8.24.3; 9.0.0 to before 9.9.2 | 6.13.11, 7.8.12, 8.24.3, 9.9.2 | Patch available | CNA |
| — | mongoose (npm) | before 6.13.11 | 6.13.11 | Patch available | GHSA-pcrw-h46h-c93h |
| — | mongoose (npm) | 7.0.0 to before 7.8.12 | 7.8.12 | Patch available | GHSA-pcrw-h46h-c93h |
| — | mongoose (npm) | 8.0.0 to before 8.24.3 | 8.24.3 | Patch available | GHSA-pcrw-h46h-c93h |
| — | mongoose (npm) | 9.0.0 to before 9.9.2 | 9.9.2 | Patch available | GHSA-pcrw-h46h-c93h |
- mongoose VendorAutomattic Affected before 6.13.11; 7.0.0 to before 7.8.12; 8.0.0 to before 8.24.3; 9.0.0 to before 9.9.2 Fixed in 6.13.11, 7.8.12, 8.24.3, 9.9.2 Patch available CNA
- mongoose (npm) Vendor— Affected before 6.13.11 Fixed in 6.13.11 Patch available GHSA-pcrw-h46h-c93h
- mongoose (npm) Vendor— Affected 7.0.0 to before 7.8.12 Fixed in 7.8.12 Patch available GHSA-pcrw-h46h-c93h
- mongoose (npm) Vendor— Affected 8.0.0 to before 8.24.3 Fixed in 8.24.3 Patch available GHSA-pcrw-h46h-c93h
- mongoose (npm) Vendor— Affected 9.0.0 to before 9.9.2 Fixed in 9.9.2 Patch available GHSA-pcrw-h46h-c93h
Remediation
Upgrade Mongoose to 6.13.11, 7.8.12, 8.24.3, or 9.9.2, matching the release line in use. Red Hat lists one of its products as not affected.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · CNA mongoose (Automattic) Fixed in 6.13.11, 7.8.12, 8.24.3, 9.9.2
- Fix · GHSA-pcrw-h46h-c93h mongoose (npm) Fixed in 6.13.11 Advisory →
- Fix · GHSA-pcrw-h46h-c93h mongoose (npm) Fixed in 7.8.12 Advisory →
- Fix · GHSA-pcrw-h46h-c93h mongoose (npm) Fixed in 8.24.3 Advisory →
- Fix · GHSA-pcrw-h46h-c93h mongoose (npm) Fixed in 9.9.2 Advisory →
Vendor assessments
Timeline
- 2026-11-09 Threatist record created from CVE-2026-125120
- 2026-11-10 Alias added: GHSA-pcrw-h46h-c93h
- 2026-11-10 Fix available: npm/[email protected], npm/[email protected], npm/[email protected] +1 · GHSA-pcrw-h46h-c93h
- 2026-11-10 CVSS score added · GHSA-pcrw-h46h-c93h
- 2026-11-10 Weakness changed · GHSA-pcrw-h46h-c93h
- 2026-11-10 11 new references · GHSA-pcrw-h46h-c93h
- 2026-11-12 Affected versions changed · Red Hat
- 2026-11-12 CVSS score added · Red Hat
- 2026-11-13 CISA SSVC decision points changed
References
Other 10
- https://github.com/Automattic/mongoose/security/advisories/GHSA-pcrw-h46h-c93h
- https://github.com/Automattic/mongoose/commit/7e912af3fac52cb0eea4cd71e24d65318916831a
- https://github.com/Automattic/mongoose/commit/8b10d5760bb181f5bf5d01495cde161c8aed0557
- https://github.com/Automattic/mongoose/commit/b1df045aab076b740fdaec14a15a44c694b85b7d
- https://github.com/Automattic/mongoose/commit/b5003d3915db1cf9209c38a4b93cf3a92cddd710
- https://github.com/Automattic/mongoose/releases/tag/6.13.11
- https://github.com/Automattic/mongoose/releases/tag/7.8.12
- https://github.com/Automattic/mongoose/releases/tag/8.24.3
- https://github.com/Automattic/mongoose/releases/tag/9.9.2
- https://github.com/Automattic/mongoose
More Automattic vulnerabilities
- TI-2023-12700 Improper authentication in WooCommerce Payments WordPress Plugin CVSS 3.1CRITICAL 9.8
- TI-2023-03453 Prototype Pollution in automattic/mongoose CVSS 3.1CRITICAL 9.8
- TI-2024-06106 Jetpack Boost < 3.4.7 - Admin+ SSRF CVSS 3.1CRITICAL 9.1
- TI-2013-01782 WordPress W3 Total Cache Plugin 0.9.2.8 has a Remote PHP Code Execution Vulnerability CVSS 3.1CRITICAL 9.8
- TI-2026-87413 Prototype pollution in Mongoose allows overwriting built-in functions CVSS 3.1HIGH 8.2
- TI-2022-02368 Prototype Pollution in automattic/mongoose CVSS 3.1CRITICAL 9.8
Sources
- CVE-2026-125120 · CVE Program
- CVE-2026-125120 · NVD
- FIRST EPSS
- GHSA-pcrw-h46h-c93h · GitHub Advisory Database · CC BY 4.0
- CVE-2026-125120 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences