Malformed namespace handling can crash clients and disclose heap memory in MongoDB C Driver

Note: This data is for reference and cybersecurity research purposes only.CyStack advises users not to use this information for unlawful purposes.

What is CVE-2026-120956?

CVE-2026-120956 is a vulnerability classified as Reachable Assertion, affecting C Driver (affected versions: 1.25.0 – ≤ 1.30.14 and 2.0.0 – ≤ 2.5.7). This vulnerability is rated High, with a CVSS score of 7.1. Current sources do not report this vulnerability as exploited.

Overview

Original source data

The MongoDB C Driver does not validate the type or format of a namespace field returned by the server in a query response. A MongoDB endpoint that a client application connects to, without needing any credentials, can return a malformed value in that field. This causes the client application process to terminate, and can also cause the driver to read memory outside an allocated buffer and to send a small amount of the application's own uninitialized heap memory back to the endpoint in a follow-up command. The impact is limited to the process that embeds the driver.

Affected products and scope

  • MongoDB C Driver 1.25.0 through 1.30.14 inclusive is marked affected. MongoDB's Jira issue records the fix in 1.30.15.
  • MongoDB C Driver 2.0.0 through 2.5.7 inclusive is marked affected. MongoDB's Jira issue records the fix in 2.5.8.
  • The record's default status is unaffected for versions not covered by the affected entries above. The record does not confirm the status of every other release branch.

Technical details

MongoDB C Driver does not validate the type or format of the namespace field returned by the server in a query response. A malicious or compromised MongoDB endpoint can return a malformed value in that field without requiring credentials. When the client application processes the response, the driver can terminate the application process, read outside an allocated buffer, and send a small amount of the application's uninitialized heap memory back to the endpoint in a follow-up command. MongoDB's Jira issue identifies a specific case involving an embedded NUL in the namespace. The weakness is classified as CWE-617, Reachable Assertion. The public record does not identify the exact parsing routine, the amount of memory that may be disclosed, or additional deployment conditions.

Exploitability

The issue is reachable over the network when a client application connects to a MongoDB endpoint that can return a malicious or modified query response. The endpoint does not need to provide credentials for this behavior, and the record describes user interaction as passive because the application only needs to process the response during normal operation. The recorded attack complexity is low. The supplied record marks public exploit as false, and the returned enrichment records exploitation as none. That does not establish that exploitation is impossible, and no specific campaign or victim is identified.

Technical impact

The flaw can terminate a process embedding MongoDB C Driver when it processes a query response containing a namespace value with an invalid type or format. The driver may also read outside an allocated buffer and send a small amount of the application's uninitialized heap memory in a follow-up command, creating a limited confidentiality impact within that client process. No integrity impact is confirmed, and the record provides no evidence that the issue extends to other processes or systems. Operationally, an application dependent on the affected client process may stop serving requests until it is restarted or failed over.

Business impact

  • Applications using MongoDB C Driver may terminate while processing a specially formed query response, causing service interruption at the client process level.
  • Under some conditions, a small amount of the application's uninitialized heap memory may be sent back to the endpoint, creating a limited risk of transient in-memory data disclosure.
  • The confirmed impact is limited to the process embedding the driver, with no established ability to modify data or control other processes.
  • Operational severity depends on the client application's role and whether it can be restarted or failed over.

Remediation

  1. Upgrade the affected MongoDB C Driver 1.x branch to 1.30.15 and the affected 2.x branch to 2.5.8. Use the confirmed fix corresponding to the deployed branch rather than assuming that one branch's fix covers another.
  2. Inventory every application embedding MongoDB C Driver and compare the version present in deployed binaries or dependency metadata with the affected ranges.
  3. If an upgrade cannot be completed immediately, restrict application connections to trusted MongoDB endpoints and treat potentially compromised endpoints as unsafe. This is a precaution based on the documented attack precondition, not a replacement for the fix.
  4. After upgrading, validate applications that process query responses and monitor for abnormal client crashes or aborts during rollout. The record does not provide a separate vendor mitigation beyond applying the fixed releases.

Detection

  1. Inventory applications and binaries that embed MongoDB C Driver, then identify the driver version from package metadata, dependency manifests, or build information.
  2. Prioritize applications that connect to MongoDB endpoints outside the organization's full control, especially untrusted or potentially compromised endpoints.
  3. Where protocol inspection or response capture is available, review query responses for namespace values with an invalid type or format. MongoDB's Jira issue identifies an embedded NUL case.
  4. Review client process crash, abort, and application telemetry occurring after MongoDB query responses. This is precautionary monitoring, not a confirmed indicator.
  5. No specific log signature, IOC, or leaked-byte pattern is provided. The absence of a matching log event does not prove that a system is safe.
Sources (7)
Learn more

Run an in-depth assessment with complete web risk management

CyStack VulnScan continuously discovers assets, validates vulnerabilities, and helps security teams prioritize remediation across the organization.