Skip to main content

Mongoose EUVDEUVD-2026-120502

| CVE-2026-125119 HIGH
Improper Neutralization of Special Elements in Data Query Logic (CWE-943)
2026-11-09 GitHub_M GHSA-gg4r-jv3p-qx3c
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit crafted JSON to query endpoint
  2. Delivery
    Inject { $ne: null } as password filter value
  3. Exploit
    Connection-level sanitizeFilter silently not applied
  4. Execution
    Operator matches victim record without literal password
  5. Impact
    Authentication bypass / account record disclosure

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Query language parameterization
Exploitation Conditions

Exploitation requires a specific, confirmed configuration: the application must enable sanitizeFilter at the CONNECTION level via mongoose.connect() or createConnection(uri, { sanitizeFilter: true }) and rely on it as its query-selector-injection defense, AND it must pass an attacker-controlled object (e.g. a parsed JSON request body) directly into a query filter value such as a password field. Under that configuration the defense silently never runs even though Connection#get('sanitizeFilter') reports true. LIMITING FACTORS that reduce real-world exposure: applications that enable sanitizeFilter globally via mongoose.set('sanitizeFilter') or per-query via Model.find().sanitizeFilter() are explicitly NOT affected; applications that validate/cast user input to primitives before querying are not exploitable; and affected deployments must run Mongoose 6.0.0 through 6.13.11, 7.0.0-7.8.12, 8.0.0-8.24.6, or 9.0.0-9.11.3. No special conditions beyond that configuration are needed once present - the attacker needs no authentication or user interaction.

Impact

The input signals point to a genuine but narrowly-scoped priority rather than a universal emergency. The provided CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/C:H/I:N/A:N = 7.5 HIGH) describes trivial, unauthenticated, network-reachable exploitation with high confidentiality impact and no integrity/availability impact, consistent with CWE-943 (NoSQL query-selector injection). The vuln.today decision label is 'this_week', which is urgent but below act_now/emergency. No CISA KEV entry is present, so this is not confirmed actively exploited. No EPSS score was supplied, so exploitation probability cannot be quantified from the input. The GHSA advisory (GHSA-gg4r-jv3p-qx3c) includes a working proof-of-concept and the fixing commit (4bb6594) confirms the exact code defect, so the bug is real and well-understood. The key nuance that lowers real-world risk below what the raw 7.5 suggests: the flaw only manifests when an application specifically enables sanitizeFilter at the connection level (mongoose.connect()/createConnection({sanitizeFilter:true})) AND relies on it as its injection defense AND passes attacker-controlled objects into query filters. Applications using the global mongoose.set('sanitizeFilter') or per-query Model.find().sanitizeFilter() are explicitly unaffected, and applications that never enable sanitizeFilter at all are not made newly vulnerable by this bug - they were already responsible for their own input validation. The danger is the false sense of security: Connection#get('sanitizeFilter') returns true while the defense silently never runs.

Exploit ScenarioDerived

An application uses Mongoose with createConnection(uri, { sanitizeFilter: true }) and forwards a user-supplied JSON login body directly into User.findOne({ username, password }). An unauthenticated attacker submits a password value of { $ne: null } (a query operator object); because the connection-level sanitizeFilter is stored in Connection.config but never read during query casting, the operator reaches MongoDB unsanitized and matches the victim's account record without the correct password, bypassing authentication and disclosing the record. The GHSA advisory publishes a demonstration proof-of-concept of exactly this flow.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 09, 2026

Mongoose ODM silently ignores the connection-level sanitizeFilter option, so applications that enable it through mongoose.connect() or createConnection(uri, { sanitizeFilter: true }) believe query-selector injection is blocked while filters pass through unsanitized. The flaw affects Mongoose 6.0.0 through 6.13.11, 7.0.0 through 7.8.12, 8.0.0 through 8.24.6, and 9.0.0 through 9.11.3, and lets an unauthenticated remote attacker who controls a filter value (for example a password field taken from a JSON request body) submit an operator object such as { $ne: null } that matches an account record without the correct literal password, disclosing protected data. Global configuration via mongoose.set('sanitizeFilter') and per-query Model.find().sanitizeFilter() are explicitly unaffected; the vendor advisory ships a proof-of-concept snippet demonstrating the bypass, though it is a public reference that has not been independently verified here as working exploit code, and no CISA KEV entry or confirmed in-the-wild exploitation is associated with this CVE. Fixed releases are 6.13.12, 7.8.13, 8.24.7, and 9.11.4.

RemediationAI

Upgrade to the fixed release for your branch: Mongoose 6.13.12, 7.8.13, 8.24.7, or 9.11.4, per the release tags and the advisory at https://github.com/Automattic/mongoose/security/advisories/GHSA-gg4r-jv3p-qx3c; the upstream fix commits are 4bb6594, 4f4f9a7, 83eda6a, and b8970c2. If upgrading cannot be done immediately, switch the defense to a mechanism the advisory states is unaffected: set it globally with mongoose.set('sanitizeFilter', true) or per query with Model.find().sanitizeFilter(), understanding the trade-offs - the global setting applies to every connection and query in the process, including internal or trusted queries that legitimately use operators (those must be wrapped with mongoose.trusted()), and the per-query form requires touching every call site so any missed query path stays unprotected. Casting or validating caller-supplied filter values to primitives before they reach a query also removes the injection primitive, at the cost of no longer accepting operator objects from clients that may rely on them. Note that reading Connection#get('sanitizeFilter') is not a reliable check on vulnerable versions, since it returns true even when sanitization never runs.

Affected VersionsENISA

Mongoose 9.0.0, < 9.11.4
Mongoose 6.0.0, < 6.13.12
Mongoose 7.0.0, < 7.8.13
Mongoose 8.0.0, < 8.24.7

Affected Packages

npm mongoose fix: 6.13.12, 7.8.13, 8.24.7, 9.11.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Mongoose is a MongoDB object modeling library for Node.js built on the official node-mongodb-native driver, and this is a case of improper neutralization of special elements in data query logic (CWE-943), the NoSQL-injection class. The sanitizeFilter defense normally wraps operator objects supplied in filter values (for example { $ne: null }) inside $eq so they are matched literally rather than interpreted as query operators. Per the GitHub advisory GHSA-gg4r-jv3p-qx3c, NativeConnection#createClient() in lib/drivers/node-mongodb-native/connection.js moves options.sanitizeFilter into Connection.config and deletes the original option, but Query.prototype._castConditions() in lib/query.js only consulted Connection.options, the global options object, and per-query options, never Connection.config. Consequently Connection#get('sanitizeFilter') reports true while the cast path never applies sanitization. The storage pattern dates to Mongoose 6.0.0 and the same mismatch was present in 9.11.2. The upstream fix in commit 4bb6594 changes both Query.prototype._castConditions() and Query.prototype.cast() to resolve the setting via model.db.config?.sanitizeFilter ?? model.db.options?.sanitizeFilter ?? model.base.options.sanitizeFilter ?? this._mongooseOptions.sanitizeFilter, giving connection-level config precedence; accompanying tests in test/query.test.js cover find, findOne, countDocuments, distinct, updateOne/Many, replaceOne, findOneAndUpdate/Replace/Delete, deleteOne/Many and cursor operations, plus useDb() inheritance and explicit false overrides. The package is distributed on npm as mongoose and tracked as cpe:2.3:a:automattic:mongoose.

Know when Mongoose gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 7.5 HIGH

Crafting a { $ne: null } operator object is trivial (AC:L) and needs no auth or interaction over the network (AV:N/PR:N/UI:N); for a vulnerable connection-level config it discloses records (C:H) with no integrity/availability impact.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Nov 09, 2026 - 23:18 EUVD
CVE Published
Nov 09, 2026 - 22:32 cve.org
HIGH 7.5

DescriptionCVE.org

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.

Technical POC Analysis

Bug class: CWE-943, Improper Neutralization of Special Elements in Data Query Logic (query selector injection / NoSQL operator injection).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A high-severity vulnerability in Mongoose ODM versions 6.0.0 through 9.11.3 causes the sanitizeFilter option to be silently ignored when set at connection time, leaving applications unknowingly exposed to query-selector injection. This allows unauthenticated remote attackers to bypass authentication and access protected data, putting customer accounts and sensitive information at risk across all affected deployments.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 54% exploitable
Prevalence
High
dominant MongoDB ODM for Node.js, millions of weekly npm downloads
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

NoSQL injection exploits databases that don't use traditional SQL syntax-like MongoDB, CouchDB, or Redis-by manipulating queries through unsanitized user input.

CVE-2025-23061 CRITICAL POC
9.0 Jan 15

Mongoose ODM for Node.js before version 8.9.5 contains a search injection vulnerability when using $where filters with p

CVE-2017-2894 CRITICAL POC
9.8 Nov 07

An exploitable stack buffer overflow vulnerability exists in the MQTT packet parsing functionality of Cesanta Mongoose 6

CVE-2017-2891 CRITICAL POC
9.8 Nov 07

An exploitable use-after-free vulnerability exists in the HTTP server implementation of Cesanta Mongoose 6.8. Rated crit

CVE-2017-2922 CRITICAL POC
9.8 Nov 07

An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.

CVE-2017-2921 CRITICAL POC
9.8 Nov 07

An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.

CVE-2023-3696 CRITICAL POC
9.8 Jul 17

Prototype Pollution in GitHub repository automattic/mongoose prior to 7.3.4. Rated critical severity (CVSS 9.8), this vu

CVE-2022-2564 CRITICAL POC
9.8 Jul 28

Prototype Pollution in GitHub repository automattic/mongoose prior to 6.4.6. Rated critical severity (CVSS 9.8), this vu

CVE-2019-19307 CRITICAL POC
9.8 Nov 26

An integer overflow in parse_mqtt in mongoose.c in Cesanta Mongoose 6.16 allows an attacker to achieve remote DoS (infin

CVE-2024-53900 CRITICAL POC
9.1 Dec 02

Mongoose before 8.8.3 can improperly use $where in match, leading to search injection. Rated critical severity (CVSS 9.1

CVE-2021-26530 CRITICAL POC
9.1 Feb 08

The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 (compiled with OpenSSL support) is vulnerable to remote OO

CVE-2021-26529 CRITICAL POC
9.1 Feb 08

The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 and 6.7-6.18 (compiled with mbedTLS support) is vulnerable

CVE-2021-26528 CRITICAL POC
9.1 Feb 08

The mg_http_serve_file function in Cesanta Mongoose HTTP server 7.0 is vulnerable to remote OOB write attack via connect

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy