HIGHCVSS v3.1 7.5Vulnerability

CVE-2026-125119

### Summary sanitizeFilter exists to stop query selector injection: it wraps operator objects such as `{ $ne: null }` in filter values in `$eq`, so they are matched literally. Set on a connection with `mongoose.connect()` or `createConnection(uri, { sanitizeFilter: true })`, the connection reports it as enabled but queries never apply it. An application that relies on the connection-level option and passes an attacker-controlled object into a filter therefore remains open to selector injection, and a password value of `{ $ne: null }` returns the account record without the password. ### Details `NativeConnection#createClient()` at `lib/drivers/node-mongodb-native/connection.js:270-272` moves `options.sanitizeFilter` into `Connection.config` and deletes the original option. `Query#_castConditions()` at `lib/query.js:2413-2423` checks `Connection.options`, the global `options`, and the per-query options, but never `Connection.config`. The defense therefore does not run even though `Connection#get('sanitizeFilter')` returns true. This storage was introduced in Mongoose 6.0.0 and the same mismatch is present in 9.11.2. ### Proof of concept ```javascript import mongoose from 'mongoose' const conn = await mongoose.createConnection('<MONGODB_URI>', { sanitizeFilter: true }).asPromise() const User = conn.model('User', new mongoose.Schema({ username: String, password: String, marker: String })) await User.create({ username: 'victim', password: 'correct-password', marker: 'PROTECTED_RECORD' }) const filter = { username: 'victim', password: { $ne: null } } console.log(conn.get('sanitizeFilter')) console.log((await User.findOne(filter).lean()).marker) ``` A control query with a literal wrong password returned no document in the same run, confirming the filter is otherwise enforced. ### Impact Connection-level `sanitizeFilter` option is not respected. Any user that relies on connection-level config and `sanitizeFilter` to defend against query selector injec

Properties

Summary
Mongoose: Connection-level sanitizeFilter not applied
Severity
high
Nvd fetched at
2026-11-10T23:33:48.924589+00:00
Epss score
0.00541
Cvss score
7.5
Cvss severity
HIGH
Retrieved at
2026-11-10T23:35:17+00:00
Ghsa published
2026-11-10T19:56:12Z
Source url
https://github.com/advisories/GHSA-gg4r-jv3p-qx3c
Ghsa updated
2026-11-10T19:56:12Z
Ghsa id
GHSA-gg4r-jv3p-qx3c
Last source
FIRST EPSS
Score
7.5
Cvss version
3.1
Cve id
CVE-2026-125119
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
First seen by Signal
2026-11-10T03:20:43+00:00
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Published at
2026-11-09T23:17:22.397

Related Entities (3)

AFFECTS (1)

→[Software]npm/mongoose

VULNERABLE_TO (1)

←[Software]npm/mongoose

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-125119 (CVSS v3.1 7.5) — Ninja Signal Threat Intelligence | Ninja Signal