Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSubmit crafted JSON body to endpoint
-
ExploitMongoose descends into inherited key (toString/valueOf)
-
ExecutionOverwrite Object.prototype.toString.call
-
ImpactLater queries throw TypeError, process denial of service
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the application to pass attacker-controlled keys into one of the three vulnerable paths: (1) building/setting a document where a Mixed path exists on an otherwise strict schema (e.g. new Model(req.body) or doc.set() with a dotted key like 'mixed.toString.call'), or any root path on a schema configured with strict:false; (2) findOneAndReplace() with an untrusted replacement, update calls chained onto an existing query, or Query.prototype.merge() with an untrusted source; or (3) merely reading a stored document that already contains a field such as {"toString":{"call":1}}, in which case any later find()/findOne()/cursor/hydrate() read triggers the overwrite with no live write path needed. The shared-schema-tampering variant additionally requires a subdocument configured with strict:false and an application that passes a user-controlled path to doc.set(path, value). Limiting factors: lean() queries are not affected; a schema with no Mixed path, no strict:false, and no untrusted replacement/merge/user-controlled set-path is not reachable through these vectors; and __proto__, constructor and prototype remain blocked, so the impact is overwriting reachable shared built-ins and Mongoose internals rather than adding new Object.prototype members. |
| Impact | The input CVSS of 8.2 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H) is driven by availability (A:H) with a low integrity component (I:L) and no confidentiality impact (C:N) - this is a denial-of-service and shared-state-tampering flaw, not data theft, so the 'Information Disclosure' tag is inconsistent with the vector and with the advisory. The vuln.today priority is 'this_week' rather than act_now/emergency, which aligns with the signal picture: there is no CISA KEV listing and no EPSS value supplied, so there is no evidence of active exploitation or of high predicted exploitation probability. However, the GHSA advisory (GHSA-8332-j7wj-wjw4) contains multiple working proof-of-concept snippets and the fixing commits are public, so a would-be attacker has a complete recipe. The net picture is a genuinely reachable, easy-to-trigger DoS in a very widely used library that is realistic to weaponize but, as of this analysis, not confirmed as being exploited in the wild - a real patch-this-week priority rather than a drop-everything emergency. Missing data to note explicitly: no EPSS score and no KEV status were provided, and the input did not carry an explicit 'POC: confirmed' flag even though the advisory itself publishes exploit code. |
| Exploit ScenarioDerived | A Node.js application builds documents from request bodies (e.g. new Model(req.body) on a schema containing a Mixed path, or findOneAndReplace() with an untrusted replacement). An unauthenticated attacker submits a JSON body such as {"meta.toString.call": 1} or {"toString":{"call":1}}, causing Mongoose to descend into the inherited Object.prototype.toString and overwrite its .call property; every subsequent query in the process then throws TypeError until the process is restarted. Working PoC snippets for all three code paths are published in the GHSA advisory, so no exploit development is required. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 09, 2026
Prototype pollution in Mongoose (all versions prior to 6.13.12, 7.8.13, 8.24.7, and 9.11.4) lets attacker-controlled keys such as toString or valueOf be written onto shared built-in functions and Mongoose internals, after which every later query in the process throws 'TypeError: _toString.call is not a function' until the process restarts. Three sinks are reachable: document hydration in init()/Model.hydrate(), dotted-path assignment through $__set, and update merging in utils.mergeClone (used by findOneAndReplace(), chained updates, and Query.prototype.merge()); a separate variant reachable through a strict:false subdocument plus an application-controlled doc.set(path, value) can strip shared validators such as required or alter schema options for all later documents in the process. The vendor advisory at GHSA-8332-j7wj-wjw4 includes proof-of-concept snippets demonstrating the overwrite; there is no CISA KEV listing and no confirmed active exploitation, and the assessed impact is availability (A:H) with low integrity impact and no confidentiality impact.
RemediationAI
Vendor-released patch: upgrade to 6.13.12, 7.8.13, 8.24.7, or 9.11.4 (npm ranges ^6.13.12, ^7.8.13, ^8.24.7, ^9.11.4); the fixes are the Object.hasOwn guards in the commits https://github.com/Automattic/mongoose/commit/18b5513dd463731a2caf0d3395ef1d9eb0735f50, https://github.com/Automattic/mongoose/commit/2a195d19a4dd240f039a0a226614d5804e8187ee, https://github.com/Automattic/mongoose/commit/3cb702b8d079c3e267f0b10f41673a1590f703c8, https://github.com/Automattic/mongoose/commit/85cf897105edfeb5f56be42a18a68704434cac82, https://github.com/Automattic/mongoose/commit/8cee51beead554df1f3d05645edb439c69eb2a9b, and https://github.com/Automattic/mongoose/commit/8eb74cb4a550cbe0225963b07aebacbd999d4b74, with details in the advisory https://github.com/Automattic/mongoose/security/advisories/GHSA-8332-j7wj-wjw4. Because a successful overwrite persists for the life of the process, restarting the Node.js workers is required to clear an already-polluted state even after the upgrade. If upgrading cannot be done this week, the advisory's own limiting conditions indicate the exposure surface to close: avoid passing untrusted objects into new Model(...) or doc.set() on schemas that contain a Mixed path or are configured with strict:false, since those are the routes into $__set and init(); do not pass untrusted replacements to findOneAndReplace(), do not chain updates carrying untrusted data onto an existing query, and do not merge untrusted source queries, since those reach utils.mergeClone; and do not forward user-controlled strings to doc.set(path, value) for strict:false subdocuments, which is the only route to the shared-schema tampering variant. lean() queries do not hydrate documents and are not affected by the init() path, so read-only endpoints can be moved to lean() as a partial reduction of exposure, at the cost of losing Mongoose document behavior on those results.
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
CWE-1321 (improperly controlled modification of object prototype attributes) applies here in a constrained form: Mongoose already blocks __proto__, constructor, and prototype, so the flaw does not add members to Object.prototype directly. Instead, three copy loops read a target by key without an own-property check, so a key naming an inherited property causes the write to land on the shared object behind that property. The CPE cpe:2.3:a:automattic:mongoose identifies the npm 'mongoose' MongoDB object-modeling library as the affected component. In init() (reached by find(), findOne(), cursors, populated documents, and Model.hydrate()), a stored field named toString makes doc[i] resolve to Object.prototype.toString, which is truthy, so hydration recurses onto that function and copies attacker-controlled subfields onto it. In Document.prototype.$__set, walking a dotted path reads obj[parts[i]] and descends into whatever it finds, including inherited functions on plain objects and prototype getters on subdocuments such as $__schema, schema, $__middleware, and $__schemaTypeOptions, which point at objects shared by every document of the model. In utils.mergeClone, the line to[key] = clone(fromObj[key]) / mergeClone(to[key], val) recurses into inherited built-ins when key is toString and the target has no own property of that name. The upstream fix adds Object.hasOwn guards in lib/document.js (init and $__set) and lib/utils.js (mergeClone), skipping keys that are inherited rather than own; accompanying tests confirm the fields are ignored and the built-ins remain intact. lean() queries bypass the hydration path and are not affected.
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:N/I:L/A:H
Attacker-supplied request data reaches the sink remotely with no auth and a single crafted key (AV:N/AC:L/PR:N/UI:N); overwriting shared built-ins yields process-wide DoS (A:H) and limited integrity impact on shared schema state (I:L), no confidentiality (C:N).
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. Prior to 6.13.12, 7.8.13, 8.24.7, and 9.11.4, Mongoose can descend into inherited properties while loading database documents in init(), setting dotted paths in $__set, and merging update documents in utils.mergeClone. Attacker-controlled keys such as toString or valueOf can therefore cause Mongoose to write into shared built-in functions instead of an own property. A crafted document, Mixed path, non-strict document or subdocument, findOneAndReplace() replacement, chained update, or Query.prototype.merge() source can overwrite Object.prototype.toString.call, causing later queries on unrelated models to fail until the process restarts. Separately, when an attacker controls the dotted path passed to doc.set(path, value) for a subdocument configured with strict: false, descent through $__set can reach $__schema and alter shared validators or schema options for later documents. Mongoose already blocks __proto__, constructor, and prototype, so this issue overwrites properties on reachable shared objects rather than adding new properties directly to Object.prototype. This issue is fixed in versions 6.13.12, 7.8.13, 8.24.7, and 9.11.4.
Blast Radius
ecosystem impact- 2 npm packages depend on mongoose (2 direct, 0 indirect)
Ecosystem-wide dependent count for version 7.0.0.
Articles & Coverage 1
Technical POC Analysis
CWE-1321 (improperly controlled modification of object prototype attributes).
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 the Mongoose library (used in Node.js applications) allows attackers to corrupt shared functions, causing database queries to fail and potentially exposing sensitive data. This affects any application using affected Mongoose versions, leading to service outages and data integrity risks that require immediate leadership attention.
Apply input validation and sanitization to block prototype pollution keys (e.g., toString, valueOf); avoid strict:false subdocuments and application-controlled doc.set calls with untrusted paths; monitor for process crashes and restart as needed; restrict network access to database endpoints.
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
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-120498
GHSA-8332-j7wj-wjw4
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB