Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain low-privilege MongoDB database credentials
-
DeliveryWrite crafted fs.files document with chunkSize=0 or malformed length field
-
ExploitWait for or trigger victim application to read the malformed GridFS file via legacy C Driver API
-
ExecutionDriver consumes unvalidated metadata
-
ImpactTrigger division-by-zero crash (DoS) or out-of-bounds read (memory disclosure)
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Hardware permission validation
|
| Exploitation Conditions | Exploitation requires all of the following specific conditions to be satisfied simultaneously. First, the target application must use the MongoDB C Driver's legacy GridFS API to read files - applications using alternative GridFS implementations or not using GridFS functionality are entirely unaffected. Second, the attacker must possess low-privilege authenticated database access sufficient to write documents to the GridFS fs.files collection (consistent with PR:L in the CVSS vector); this could be a direct database credential or an indirect path through a writable application endpoint that stores user-supplied data into GridFS. Third, AT:P (Attack Requirements: Present) in the CVSS 4.0 vector confirms that a pre-positioned malformed document must already exist in the collection at the time the vulnerable application reads it - the attacker cannot trigger the flaw in a single unauthenticated network request. Exploitation is limited by the authentication prerequisite (PR:L), the requirement to control or influence GridFS collection contents, and the scoping of the confidentiality impact to process memory (VC:L) rather than arbitrary storage or cross-scope data. Environments where GridFS collections are only writable by the application's own privileged service account and not accessible to external users or lower-trust tenants have substantially reduced exposure. |
| Impact | The CVSS 4.0 score of 6.0 (AV:N/AC:L/AT:P/PR:L/UI:N, VC:L/VI:N/VA:H) reflects a nuanced risk picture. Network reachability (AV:N) and low complexity (AC:L) broaden the potential attacker pool, but the attack requirement (AT:P) is a meaningful constraint: a malformed document must already be resident in the target GridFS collection before the vulnerable read path is triggered. Low-privilege authentication (PR:L) is additionally required, meaning unauthenticated exploitation is not supported by the CVSS vector. The dual impact profile is the most operationally significant signal: VA:H indicates a reliable crash vector (division-by-zero is deterministic), while VC:L reflects a bounded but real memory disclosure risk. No EPSS score was provided in the input data, so quantitative exploitation probability cannot be cited. This CVE is not listed in the CISA KEV catalog and no public proof-of-concept has been identified, consistent with a researcher-reported, vendor-confirmed vulnerability without observed in-the-wild abuse. In multi-tenant or shared MongoDB deployments - where one tenant can write to collections that a privileged application process subsequently reads - the AT:P precondition is substantially easier to satisfy, elevating practical risk above what the base score alone suggests. |
| Exploit ScenarioDerived | An attacker with low-privilege write access to a MongoDB instance - such as a compromised application service account or a malicious tenant in a shared deployment - inserts a crafted document into the fs.files collection with a chunkSize field set to zero and a malformed length value. When the legitimate application subsequently reads that file using the MongoDB C Driver's legacy GridFS API, the driver consumes the unvalidated metadata and either divides by the zero chunkSize (crashing the process and producing a denial of service) or performs an out-of-bounds memory read using the malformed length, returning heap memory contents that may include sensitive in-process data such as connection strings, session tokens, or other application secrets. No public proof-of-concept code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 20, 2026
The legacy GridFS API in the MongoDB C Driver fails to validate file metadata fields retrieved from the database, enabling crafted documents stored in a GridFS collection to trigger either a division-by-zero crash (denial of service) or an out-of-bounds read that exposes process memory contents to the caller. Versions in the 1.x branch before 1.30.8 and 2.x branch before 2.2.4 are affected per EUVD-2026-31132. The CVSS 4.0 score of 6.0 accurately reflects a constrained attack path requiring low-privilege database access and a pre-positioned malicious document (AT:P), with no public exploit identified at time of analysis.
RemediationAI
The primary remediation is to upgrade the MongoDB C Driver to version 1.30.8 or later for 1.x branch deployments, or to version 2.2.4 or later for 2.x branch deployments; the vendor-released patch is confirmed available per the reporter (MongoDB) and tracked at https://jira.mongodb.org/browse/CDRIVER-6281. Where immediate upgrade is not feasible, restrict write access to the fs.files and fs.chunks GridFS collections to only fully trusted application service accounts using MongoDB role-based access control - this raises the bar for an attacker to pre-position malformed documents, though it does not eliminate risk if any trusted application path can introduce externally-supplied metadata. As an additional compensating control, if the application does not strictly require the legacy GridFS API, migrating to the non-legacy GridFS implementation removes the vulnerable code path entirely, though this requires application-level changes and regression testing. Applications that do not use GridFS at all should confirm they are not linking against the legacy API surface to eliminate exposure. Note that restricting collection-level write permissions has the trade-off of potentially breaking application workflows that rely on direct GridFS document insertion.
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
The MongoDB C Driver (CPE: cpe:2.3:a:mongodb,_inc.:c_driver:*:*:*:*:*:*:*:*) is the official C-language client library used directly by applications and as an underlying component of higher-level MongoDB drivers. Its legacy GridFS API reads file metadata documents - including fields such as chunkSize and length - from the fs.files collection and uses them in arithmetic operations and memory offset calculations without adequate input validation. CWE-1285 (Improper Validation of Specified Index, Position, or Offset in Input) precisely describes the root cause: when the driver consumes a chunkSize value of zero, a downstream division operation produces a divide-by-zero fault, crashing the process. When a malformed length or offset field is accepted, the driver performs an out-of-bounds read, potentially returning arbitrary heap or stack memory contents to the application. The 'Buffer Overflow' tag attached to this CVE is a coarse automated classification; the actual mechanics are better characterised as improper offset validation leading to a read primitive rather than a classic write overflow.
Know when C Driver 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:P/PR:L/UI:N/VC:L/VI:N/VA:H/SC:N/SI:N/SA:N
AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:H
Primary rating from Vendor (mongodb).
CVSS VectorVendor: mongodb
Lifecycle Timeline
2DescriptionCVE.org
The MongoDB C Driver's legacy GridFS API accepts malformed file metadata from the database without adequate validation. Crafted documents in a GridFS collection may cause any application that reads those files via the legacy API to either crash (via a division-by-zero) or silently leak process memory contents (via an out-of-bounds read).
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.
bson before 0.8 incorrectly uses int rather than size_t for many variables, parameters, and return values. Rated medium
Heap-based buffer overflow in the TLS transport layer of the MongoDB C Driver on Windows TLS-backend builds allows the e
Namespace injection in the MongoDB C++ Driver (all versions prior to r4.5.1) allows low-privileged users of affected mul
Heap out-of-bounds write in the MongoDB C Driver (libmongoc) allows an unauthenticated attacker who controls DNS resolut
Double-free memory corruption in the MongoDB C Driver's OpenSSL-based TLS certificate revocation checking path allows a
Incorrect validation of files loaded from a local untrusted directory may allow local privilege escalation if the underl
Connection-option injection in the MongoDB C# Driver allows a low-privileged application user to introduce or suppress s
Denial of service in applications using the MongoDB C Driver's libbson library can be triggered by crafted BSON input wi
NoSQL injection in the MongoDB C# Driver's LINQ-to-aggregation translation layer allows network-accessible, unauthentica
A mongoc_bulk_operation_t may read invalid memory if large options are passed. Rated medium severity (CVSS 6.9), this vu
Sensitive KMS provider credentials supplied for client-side field-level encryption (CSFLE) in the MongoDB C# Driver are
SCRAM authentication in the MongoDB C Driver (libmongoc) fails to abort when a nonce mismatch is detected in the server'
EUVD-2026-31132
GHSA-87jr-c2qj-3qrg
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB