NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
CRITICAL severity

Mongoose: sanitizeFilter not applied on countDocumentsGHSA-pcrw-h46h-c93h

CRITICALFix: Automattic/mongoose@7e912af

GHSA-pcrw-h46h-c93h is a critical-severity (CVSS 9.8) CWE-943 vulnerability in mongoose. A fix is available for mongoose — see the affected versions and patch details below.

Also known asCVE-2026-125120
Published
Updated
Affected
4 pkgs
Patched
4 / 4
Exploits
None indexed
Exploitation data as of Nov 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.6%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs47th percentile — riskier than 47% of all scored CVEsHighest risk

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

4 pkgs affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

21Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
mongoosenpm
8.9Mdownloads / week

Description

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());
  });
});

Affected Packages

4 total 4 fixed
EcosystemPackageVulnerable rangeFix
📦npmmongooseall versions6.13.11npm install mongoose@6.13.11
📦npmmongoose≥ 7.0.0&&< 7.8.127.8.12npm install mongoose@7.8.12
📦npmmongoose≥ 8.0.0&&< 8.24.38.24.3npm install mongoose@8.24.3
📦npmmongoose≥ 9.0.0&&< 9.9.29.9.2npm install mongoose@9.9.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mongoose, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update mongoose to 6.13.11 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-pcrw-h46h-c93h is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### 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: ```javascript mongoose.plugin(function() { schema.pre('countDocuments', function() { // This will always
O3 Security · Impact-Aware SCA

Is GHSA-pcrw-h46h-c93h in your dependencies?

Find it across npm, including transitive dependencies.

Mongoose: sanitizeFilter not applied on countDocuments