Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessGain local access to target system
-
DeliveryInject malicious MongoDB URI with oversized GSSAPI username
-
ExploitApplication initializes MongoDB C Driver connection
-
ExecutionDriver performs unsafe string copy during SASL canonicalization
-
PersistHeap buffer overflow corrupts memory structures
-
ImpactExecute arbitrary code with application privileges
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Buffer copy size validation
MITRE ATT&CK
1 technique across 1 tactic: Execution 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 MongoDB C Driver to be compiled with Cyrus SASL support and the target application to process MongoDB URIs containing authMechanism=GSSAPI with attacker-influenced username components. The Local attack vector (AV:L) means the attacker must have the ability to modify inputs that construct the connection string-achievable when applications read MongoDB URIs from user-writable configuration files, environment variables the attacker can set, or application input fields that build URIs without sanitization. The vulnerability triggers during driver initialization, before network traffic or credential validation, making authentication bypass inherent. Limiting factors include: (1) GSSAPI must be explicitly enabled in the URI (not default mechanism), (2) many production deployments use hardcoded connection strings or read from protected configuration sources, (3) containerized environments with read-only filesystems and restricted environment variable modification prevent local string injection. Applications using SCRAM-SHA or x.509 authentication mechanisms instead of GSSAPI are not vulnerable through this code path. |
| Impact | CVSS 8.6 (High severity) reflects maximum impact (VC:H/VI:H/VA:H) with low complexity (AC:L) and no privileges required (PR:N), but the Local attack vector (AV:L) significantly constrains real-world exploitability compared to a network-based vulnerability. The attacker must control input to the MongoDB URI construction-feasible in scenarios where applications accept user-supplied connection strings, read URIs from user-writable configuration files, or use environment variables an attacker can modify. No EPSS score provided, limiting quantitative exploitation probability assessment. Not listed in CISA KEV, indicating no confirmed active exploitation. Vendor acknowledgment via JIRA (CDRIVER-6134) confirms the issue but patch availability is not confirmed from the single reference. Primary risk scenarios: containerized environments where attackers control environment variables, configuration management systems with insufficient input validation, and multi-tenant platforms where users can specify database connection parameters. The pre-authentication trigger elevates risk in high-security contexts where the vulnerable code path executes with elevated privileges. Missing data: EPSS probability, POC availability, confirmed fix version, affected version range-assessment confidence is moderate pending vendor security advisory with complete remediation guidance. |
| Exploit ScenarioDerived | An attacker with local access to a server running an application that uses MongoDB C Driver with GSSAPI authentication plants a malicious MongoDB URI in a configuration file or environment variable (e.g., MONGODB_URI). The URI contains an excessively long or specially crafted username component: mongodb://AAAAA[2048 bytes]AAAAA@localhost/?authMechanism=GSSAPI. When the application initializes the database connection, the driver's SASL username canonicalization routine performs unsafe strcpy operations, overflowing a heap buffer with attacker-controlled data. By carefully structuring the overflow payload, the attacker corrupts heap metadata to achieve arbitrary code execution with the privileges of the application process-before any authentication occurs. In containerized environments where users control environment variables, this enables container escape or lateral movement without valid database credentials. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – May 06, 2026
Heap buffer overflow in MongoDB C Driver's Cyrus SASL integration allows local attackers to achieve code execution before authentication by providing a maliciously crafted username in a MongoDB URI with GSSAPI authentication. The vulnerability triggers during username canonicalization via unsafe string copying, requiring no privileges or user interaction. Exploitable against any application using the affected driver that processes untrusted MongoDB connection strings. No active exploitation confirmed (not in CISA KEV). EPSS data not provided. Vendor has acknowledged the issue via JIRA tracking (CDRIVER-6134).
Earlier versions of this analysis (1)
Heap buffer overflow in MongoDB C Driver's Cyrus SASL integration allows local code execution before authentication completes. Triggered when applications pass untrusted input as username in MongoDB connection URIs with authMechanism=GSSAPI. Affects MongoDB C Driver during username canonicalization in SASL authentication flow. No public exploit identified at time of analysis, though the pre-authentication trigger and low attack complexity (CVSS AV:L/AC:L/PR:N/UI:R) suggest exploitation is straightforward given local access and user interaction. EPSS and KEV data not available; exploitation likelihood depends heavily on whether applications accept user-controlled MongoDB URIs.
RemediationAI
Consult MongoDB JIRA issue CDRIVER-6134 (https://jira.mongodb.org/browse/CDRIVER-6134) for vendor-confirmed fix version and apply the patched MongoDB C Driver release immediately. Until patching is complete, implement these compensating controls with noted trade-offs: (1) Disable GSSAPI authentication mechanism if not operationally required-removes attack surface but eliminates Kerberos SSO capability; validate that authMechanism=GSSAPI is not present in any MongoDB URIs. (2) Implement strict input validation on all sources that construct MongoDB connection strings-sanitize usernames to alphanumeric characters with maximum length of 64 bytes before URI construction; this may break legitimate Kerberos principal names containing special characters. (3) Run applications using the driver with minimized filesystem and memory permissions through containers or sandboxing-reduces post-exploitation impact but adds operational complexity and may affect performance. (4) Use read-only configuration sources for MongoDB URIs that are not modifiable by untrusted users-limits local attack vector but requires infrastructure changes. Monitor vendor security advisories at https://www.mongodb.com/alerts for official patching guidance and regression testing recommendations.
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 (libmongoc) implements SASL authentication mechanisms including GSSAPI (Kerberos) through integration with the Cyrus SASL library. During the username canonicalization phase-which occurs before network traffic or credential validation-the driver performs string operations to normalize the username extracted from the MongoDB URI. The vulnerability stems from CWE-120 (Buffer Copy without Checking Size of Input), where unbounded string copying to a heap-allocated buffer enables overflow when processing excessively long or specially-crafted usernames. The CVSS 4.0 vector indicates Local attack vector (AV:L), meaning the attacker must have the ability to influence the connection string passed to applications using the driver-typically through configuration files, environment variables, or application input fields that construct MongoDB URIs. The pre-authentication nature makes this particularly severe as it bypasses all authentication controls.
Know when Mongodb 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:L/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from Vendor (mongodb) · only source for this CVE.
CVSS VectorVendor: mongodb
Lifecycle Timeline
2DescriptionCVE.org
The MongoDB C Driver's Cyrus SASL integration performs unsafe string copying during username canonicalization, enabling a heap buffer overflow before any authentication or network traffic. This may be triggered by passing untrusted input in the username of a MongoDB URI with authMechanism=GSSAPI.
Executive ViewAI
MongoDB C Driver versions with Cyrus SASL integration contain a heap buffer overflow in username canonicalization that allows unauthenticated local code execution before authentication occurs. Any application accepting untrusted MongoDB connection strings (URIs) is vulnerable to remote code execution regardless of network segmentation, directly threatening application availability and data confidentiality.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Restrict MongoDB connection string sources to hardcoded, pre-validated URIs only-reject all user-supplied or dynamically-constructed connection strings; (2) Implement strict input validation on any username component, blocking special characters and enforcing maximum length limits; (3) Disable GSSAPI authentication mechanism if Kerberos is not required for operations; (4) Deploy applications on isolated network segments with minimal lateral movement paths to reduce local attacker surface.
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.
EUVD-2026-27838
GHSA-587q-94wg-2pfp
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB