Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate to mongod with read role
-
DeliverySubmit find with crafted $where JavaScript
-
ExploitTrigger BSON-to-JS array conversion
-
ExecutionDereference freed heap object
-
ImpactLeak mongod memory or crash process
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, write limits
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Privilege Escalation The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires (1) valid authenticated credentials with at least read privileges on a target collection, (2) the server-side JavaScript engine enabled - i.e. mongod started without security.javascriptEnabled: false / --noscripting (enabled by default in standard MongoDB installations), and (3) the attacker's role permits invoking JavaScript-capable operators such as $where, $function, $accumulator or mapReduce. Exploitation does not need user interaction and is reachable over the standard wire protocol; it is limited to deployments where scripting has not been disabled and to principals who can submit query predicates. |
| Impact | The published CVSS 4.0 score of 8.7 (AV:N/AC:L/PR:L/UI:N/VC:H/VI:H/VA:H) treats this as a near-RCE class issue, but the description scopes impact to information disclosure and crash - not code execution or data tampering - so the VI:H rating appears overstated and should be treated cautiously. Realistic risk is mid-to-high: exploitation requires authenticated access with read privileges plus the right to invoke server-side JavaScript, which is disabled by default in many hardened deployments and explicitly discouraged by MongoDB. There is no EPSS data, no KEV entry, no public PoC, and the only reference is the vendor's own JIRA ticket, suggesting limited attacker awareness today; priority should be elevated where $where/$function is permitted to untrusted or shared-tenant principals, and routine otherwise. |
| Exploit ScenarioDerived | An attacker with credentials for a low-privileged read-only application account connects to mongod and issues a find() with a crafted $where JavaScript predicate (or an aggregation stage using $function) against a collection containing specifically shaped BSON arrays. The BSON-to-JS conversion frees an internal object and then re-reads it, returning freed heap contents to the query result or crashing the server; repeated queries either exfiltrate fragments of process memory (potentially including other users' query data or auth material) or take the database offline. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 12, 2026
Memory disclosure and denial of service in MongoDB Server's server-side JavaScript engine allow an authenticated user with read privileges and JavaScript execution rights to read freed heap memory or crash the mongod process. The flaw is triggered during BSON-to-JavaScript array conversion when operators such as $where or $function are evaluated. No public exploit identified at time of analysis, and the issue is not listed in CISA KEV; it was self-reported by MongoDB.
RemediationAI
No vendor-released patch identified at time of analysis in the provided data - track https://jira.mongodb.org/browse/SERVER-128125 for the fixed build numbers across the 6.0, 7.0, and 8.x release lines and upgrade as soon as MongoDB publishes them. As a compensating control, disable server-side JavaScript execution by starting mongod with security.javascriptEnabled: false (or --noscripting), which blocks $where, $function, $accumulator and mapReduce JavaScript and prevents reaching the vulnerable conversion path; the trade-off is that applications relying on those operators will break and must be rewritten to use aggregation pipeline equivalents. Where JavaScript cannot be disabled, revoke the find/read role from accounts that do not strictly need it and audit roles granting JavaScript-capable operators, since PR:L means any authenticated reader who can issue $where is sufficient to trigger the bug.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
MongoDB embeds a server-side JavaScript engine (historically SpiderMonkey) that converts BSON documents - MongoDB's binary serialization format - into native JavaScript values so query predicates like $where and aggregation $function can operate on them. The bug lives in the BSON-to-JS array conversion path, where an object reference is freed but subsequently dereferenced. NVD assigns CWE-787 (out-of-bounds write), but the description explicitly characterizes the root cause as a use-after-free (CWE-416); the practical effect is the same class of C/C++ memory-safety bug in the conversion routine, leaking adjacent heap contents or causing a fatal access violation in mongod.
Know when MongoDB 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
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Network-reachable mongod, low-complexity query, authenticated read role required (PR:L); high confidentiality from memory disclosure and high availability from crash, but no integrity impact described.
Primary rating from Vendor (mongodb).
CVSS VectorVendor: mongodb
Lifecycle Timeline
1DescriptionCVE.org
A use-after-free vulnerability exists in MongoDB Server's server-side JavaScript engine when converting BSON documents to JavaScript arrays. An authenticated user with read privileges who is able to run server-side JavaScript (for example, via $where or $function) can cause the server to access memory that has already been freed. This may result in disclosure of information from the mongod process memory or a denial of service through a server crash.
Executive ViewAI
MongoDB Server is vulnerable to memory disclosure and denial-of-service attacks through authenticated users exploiting the JavaScript query engine ($where and $function operators). Attackers with database read access can extract sensitive data from server memory or crash the mongod process, directly threatening both data confidentiality and service availability. Organizations using MongoDB should prioritize restricting JavaScript-based query execution.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict JavaScript execution privileges to administrative accounts only; (2) Disable $where and $function operators if not required by applications; (3) Implement database-level access controls limiting query execution to trusted application service accounts; (4) Monitor mongod process logs and system resource usage for anomalies indicating exploitation.
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
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
MongoDB before 2.0.9 and 2.2.x before 2.2.4 does not properly validate requests to the nativeHelper function in SpiderMo
Use-after-free in MongoDB Server's replication component can terminate replica set members unexpectedly and, under certa
The find prototype in scripting/engine_v8.h in MongoDB 2.4.0 through 2.4.4 allows remote authenticated users to cause a
The MongoDB bson JavaScript module (also known as js-bson) versions 0.5.0 to 1.0.x before 1.0.5 is vulnerable to a Regul
Remote code execution in Chartbrew versions prior to 4.8.1 allows authenticated attackers with high privileges to execut
After user deletion in MongoDB Server the improper invalidation of authorization sessions allows an authenticated user's
The default configuration for MongoDB before 2.3.2 does not validate objects, which allows remote authenticated users to
Unauthenticated MongoDB filter erasure in Budibase Server 3.39.18 through 3.44.0 lets a remote attacker read, modify, or
Authenticated command injection in Dokploy before 0.31.1 lets any user who can update a MySQL, PostgreSQL, MariaDB, Mong
SimStudio below 0.5.74 has a missing authorization on MongoDB tool endpoints that allows attackers to execute arbitrary
MongoDB Server may access non-initialized region of memory leading to unexpected behaviour when zero arguments are calle
MongoDB Compass may be susceptible to code injection due to insufficient sandbox protection settings with the usage of e
Same weakness CWE-787 – Out-of-bounds Write
View allSame technique Buffer Overflow
View allVendor StatusVendor
Debian
| Release | Status | Fixed Version | Urgency |
|---|---|---|---|
| (unstable) | fixed | (unfixed) | - |
EUVD-2026-36373
GHSA-x5xf-rwjm-436w
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB