Skip to main content

MongoDB C Driver CVE-2026-6691

| EUVDEUVD-2026-27838 HIGH
Classic Buffer Overflow (CWE-120)
2026-05-06 mongodb GHSA-587q-94wg-2pfp
8.6
CVSS 4.0 · Vendor: mongodb
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Gain local access to target system
  2. Delivery
    Inject malicious MongoDB URI with oversized GSSAPI username
  3. Exploit
    Application initializes MongoDB C Driver connection
  4. Execution
    Driver performs unsafe string copy during SASL canonicalization
  5. Persist
    Heap buffer overflow corrupts memory structures
  6. Impact
    Execute 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 May 06, 2026 - 16:00 CVSS 7.8

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

MongoDB C Driver 2.1.0 ≤2.1.2

Affected Packages

euvd mongodb_c_driver no fix

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

Vendor (mongodb) PRIMARY 8.6 HIGH
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

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Analysis Updated
May 06, 2026 - 16:28 vuln.today
v2 - CVSS changed
CVSS changed
May 06, 2026 - 16:22 NVD
7.8 (HIGH) 8.6 (HIGH)

DescriptionCVE.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

Why It Matters

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.

Business Impact: High
Compensating Controls

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

EPSS Score
0.0%
Top 96% exploitable
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

43
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +43
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy