Every CVESearch/Get API key

CVE-2026-125120

Mongoose: sanitizeFilter not applied on countDocuments

9.8 CriticalFix available

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

0.57%Unchanged since Nov 10, 2026
90%50%10%1%

What each source reports

CVE List Score used9.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 CriticalCVSS: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-1205039.8

Mongoose: sanitizeFilter not applied on countDocuments

Record
EUVD-2026-120503
CVSS 3.1
9.8 CriticalCVSS: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-c93h9.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.

  1. ^9.9.2
  2. ^8.24.3
  3. ^7.8.12
  4. ^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 CriticalCVSS: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
NVD9.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 CriticalCVSS: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
OSV9.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 CriticalCVSS: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-c93h9.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.

  1. ^9.9.2
  2. ^8.24.3
  3. ^7.8.12
  4. ^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 CriticalCVSS: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

Affected packages
PackageAffectedFixed
mongoose
npm
before 6.13.11
6.13.11
mongoose
npm
7.0.0 up to 7.8.12
7.8.12
mongoose
npm
8.0.0 up to 8.24.3
8.24.3
mongoose
npm
9.0.0 up to 9.9.2
9.9.2
mongoose
TuxCare: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

History
RecordedChangedSources
affected, aliasesOSV
publishedEUVD
affected, referencesOSV
affected, facts, referencesGitHub Advisories
aliases, referencesNVD, OSV
cwes, references, severity, titleCVE List
first indexedEUVD

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

Show 7 moreShow less
MoveEnter Open