Skip to main content
← Vulnerabilities

Mongoose: Connection-level sanitizeFilter not applied

Affects Mongoose apps that enable sanitizeFilter at the connection level and pass objects into query filters. Fixed in 6.13.12, 7.8.13, 8.24.7, and 9.11.4 for each branch.

Written by anthropic/claude-haiku-5.5 from the sources below. Verify against them.

7.5HighCNA
Exploited
No known exploitation
Fix
Fixed in 6.13.12, 7.8.13, 8.24.7, 9.11.4
Who is exposed
Specific setups only

Do first: Check whether your setup matches what the bug needs. Connection-level sanitizeFilter enabled via mongoose.connect() or createConnection() Affected Mongoose versions: before 6.13.12, 7.0.0 through 7.8.12, 8.0.0 through 8.24.6, and 9.0.0 through 9.11.3 Application passes an attacker-controlled object into a query filter

Published
Last modified
20/100 · provisional
Specific setups only
None on Exploit-DB, Metasploit or GitHub

Summary

Mongoose, a Node.js library for modeling MongoDB data, fails to apply the connection-level sanitizeFilter setting, so an attacker can remotely, without logging in, send query operator objects that bypass filtering and match records without the expected literal value, such as a password. The flaw affects applications that enable sanitizeFilter through mongoose.connect() or createConnection() and pass untrusted input into query filters, while the global and per-query settings still work.

Read the original description

Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. From 6.0.0 until 6.13.12, 7.8.13, 8.24.7, and 9.11.4, Mongoose stores the connection-level sanitizeFilter option in Connection.config, but Query.prototype._castConditions() and query casting check other option locations and do not read that configuration. An application that enables sanitizeFilter through mongoose.connect() or createConnection() and passes an attacker-controlled object into a query filter therefore receives a connection that reports the defense as enabled while query selector objects remain unsanitized. A crafted password value using a query operator can match an account record without the expected literal password, while global configuration through mongoose.set('sanitizeFilter') and per-query Model.find().sanitizeFilter() remain unaffected. This issue is fixed in versions 6.13.12, 7.8.13, 8.24.7, and 9.11.4.

cve.now Index

20Pcve.now Index 20 of 100 · methodology v3 · provisional
  • Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
  • Exposure12/25Specific setups only, reachable over the network without a login
  • Reach?/20Unknown. No tracked technology or package matched
  • Severity7.5/10CVSS 7.5
  • No patch0/5No signal

What would change the score

  • Would score about 70 if added to CISA KEV
  • Would score about 65 if CISA's SSVC rates exploitation active

What to do

  • Check whether your setup matches what the bug needs.

    Connection-level sanitizeFilter enabled via mongoose.connect() or createConnection() Affected Mongoose versions: before 6.13.12, 7.0.0 through 7.8.12, 8.0.0 through 8.24.6, and 9.0.0 through 9.11.3 Application passes an attacker-controlled object into a query filter
  • Upgrade to a fixed version: 6.13.12, 7.8.13, 8.24.7, 9.11.4.

Timeline

  1. CVE published
  2. First seen by cve.now

Affected versions

  • Automattic mongoose

    From 6.0.0 · fixed in 6.13.12; From 7.0.0 · fixed in 7.8.13; From 8.0.0 · fixed in 8.24.7; From 9.0.0 · fixed in 9.11.4

Evidence 9

  1. Advisory
  2. Repository
  3. Repository
  4. Repository
  5. Repository
Show all 9 sourcesShow fewer sources
  1. Repository
  2. Repository
  3. Repository
  4. Repository

Corrections

None so far.

Something wrong on this page? Report an error. Every fix is listed here.

Questions about CVE-2026-125119

Is CVE-2026-125119 being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.Source: cve.now feed data

What does this mean?

The connection-level sanitizeFilter setting is not applied to queries. A query operator object passed as a password value can then match an account record without knowing the real password, which exposes that record.Source: github.com

Which versions are affected by CVE-2026-125119?

mongoose: from 6.0.0 before 6.13.12; from 7.0.0 before 7.8.13; from 8.0.0 before 8.24.7; from 9.0.0 before 9.11.4.Source: cve.now feed data

Am I affected, and how do I check?

Mongoose before 6.13.12, 7.0.0 through 7.8.12, 8.0.0 through 8.24.6, and 9.0.0 through 9.11.3. The setup involves sanitizeFilter enabled via mongoose.connect() or createConnection() with objects passed into a query filter. Check the installed version with npm ls mongoose or the mongoose entry in package.json.Source: github.com

How do I fix CVE-2026-125119?

Upgrade to the fixed release for your branch: 6.13.12, 7.8.13, 8.24.7, or 9.11.4.Source: github.com