Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted JSON to query endpoint
-
DeliveryInject { $ne: null } as password filter value
-
ExploitConnection-level sanitizeFilter silently not applied
-
ExecutionOperator matches victim record without literal password
-
ImpactAuthentication 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
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.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
Mongoose ODM for Node.js before version 8.9.5 contains a search injection vulnerability when using $where filters with p
An exploitable stack buffer overflow vulnerability exists in the MQTT packet parsing functionality of Cesanta Mongoose 6
An exploitable use-after-free vulnerability exists in the HTTP server implementation of Cesanta Mongoose 6.8. Rated crit
An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.
An exploitable memory corruption vulnerability exists in the Websocket protocol implementation of Cesanta Mongoose 6.8.
Prototype Pollution in GitHub repository automattic/mongoose prior to 7.3.4. Rated critical severity (CVSS 9.8), this vu
Prototype Pollution in GitHub repository automattic/mongoose prior to 6.4.6. Rated critical severity (CVSS 9.8), this vu
An integer overflow in parse_mqtt in mongoose.c in Cesanta Mongoose 6.16 allows an attacker to achieve remote DoS (infin
Mongoose before 8.8.3 can improperly use $where in match, leading to search injection. Rated critical severity (CVSS 9.1
The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 (compiled with OpenSSL support) is vulnerable to remote OO
The mg_tls_init function in Cesanta Mongoose HTTPS server 7.0 and 6.7-6.18 (compiled with mbedTLS support) is vulnerable
The mg_http_serve_file function in Cesanta Mongoose HTTP server 7.0 is vulnerable to remote OOB write attack via connect
EUVD-2026-120502
GHSA-gg4r-jv3p-qx3c
NVD
CVE.org
EPSS
Exploit-DB