Skip to content

Get notified

Get an email when a new major security incident drops. No spam, unsubscribe any time.

Only used for pwn.watch incident emails. Protected by Cloudflare Turnstile.

LivePatchedPatch now

Mongoose did not apply sanitizeFilter to countDocuments, allowing NoSQL query injection

Mongoose (Automattic/mongoose) countDocuments()

Brought to you byTinkerer Club

The private club for people who own their servers, run their own AI, and pay $0/month for software.

Mongoose's sanitizeFilter option was not applied to countDocuments(), so user input passed to it could inject MongoDB query operators (CVE-2026-125120). Fixes shipped on Aug 10 2026 in 6.13.11, 7.8.12, 8.24.3 and 9.9.2; the advisory was published on Nov 2 and reviewed by GitHub on Nov 10. Until you update, a global pre('countDocuments') plugin that runs mongoose.sanitizeFilter on the query filter works around it.

Why this severity: Rated critical; query injection through countDocuments() despite sanitizeFilter

Started
Aug 10, 2026

Follow this incident

Affected

  • Releases before 6.13.11, 7.8.12, 8.24.3 and 9.9.2 on their branches

Fixed in

  • 6.13.11
  • 7.8.12
  • 8.24.3
  • 9.9.2

Timeline3

  1. GitHub reviews the advisory.

  2. The advisory GHSA-pcrw-h46h-c93h is published.

  3. Mongoose 6.13.11, 7.8.12, 8.24.3 and 9.9.2 ship the fix.

Advisories3

Notes & caveats

Social posts mention four more flaws fixed in the same release, with PoCs; they are not covered by the listed advisory.

Get an email when a new major security incident drops. No spam, unsubscribe any time.