CVE-2026-135222 in C Driver
Summary
by MITRE • 11/25/2026
MongoDB C Driver contains an incorrect authorization weakness in the credential-selection logic used by its AWS authentication mechanism. A process-wide credential cache can take precedence over the credentials supplied for an individual connection, so a connection configured with one set of credentials may instead be authenticated under an identity cached earlier in the same process. A party able to cause the application process to open an additional connection may thereby obtain unintended privileges.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 11/25/2026
The MongoDB C Driver contains a critical authorization weakness within its credential-selection logic, specifically affecting the AWS authentication mechanism. This vulnerability stems from an incorrect implementation of how credentials are cached and applied during connection establishment. In typical multi-tenant or complex application environments where multiple database connections with distinct identities might be established within a single process, this flaw allows for identity confusion. The core issue lies in the precedence rules governing credential selection, which incorrectly prioritize a global, process-wide credential cache over specific credentials provided for an individual connection instance.
When an application initializes its first MongoDB connection using AWS authentication, the driver caches these credentials at the process level to optimize subsequent authentications and reduce overhead. However, when a second or subsequent connection is opened within that same process with different intended credentials, the driver fails to correctly isolate this new request from the global cache. Instead of utilizing the specific credentials supplied for the new connection context, the authentication logic retrieves and applies the previously cached identity associated with an earlier connection in the same process lifetime. This behavior violates the principle of least privilege by allowing a connection configured for one set of permissions to authenticate as another user or service account that was authenticated earlier.
The operational impact of this vulnerability is significant potential for unauthorized access and privilege escalation within the database environment. An attacker who can influence the application's execution flow, such as through injection attacks or logic manipulation in an untrusted input path, may be able to force the opening of a new connection with specific credentials intended for limited access. Due to the caching flaw, this connection will instead authenticate using the higher-privileged identity cached from a prior operation. Consequently, the attacker gains unintended privileges associated with that earlier identity, potentially allowing them to read sensitive data, modify records, or execute administrative commands they should not be authorized to perform. This effectively bypasses access control mechanisms designed to restrict specific application components or users to their designated database roles.
This vulnerability aligns with CWE-280: Improper Handling of Instructions Referenced Outside of a Limit or Boundary, as the credential selection logic improperly handles references to cached state outside the intended scope of the individual connection object. It also relates to CWE-798: Use of Hard-coded Credentials if the caching mechanism inadvertently exposes static identity information across contexts, though primarily it is an authorization bypass issue similar to CWE-269: Improper Privilege Management. In terms of attack vectors, this could be leveraged in scenarios where an attacker can trigger multiple connection openings with varying credentials within a single process session, facilitating lateral movement or privilege escalation inside the database layer without needing direct network-level exploits against MongoDB itself.
Mitigation strategies must focus on ensuring strict isolation of credential contexts per connection instance rather than relying on aggressive global caching that ignores specific configuration overrides. Developers should verify if newer versions of the MongoDB C Driver have addressed this logic error by implementing context-aware credential resolution that prioritizes explicit connection-specific credentials over process-wide caches when explicitly provided. If upgrading is not immediately feasible, application-level workarounds include ensuring that connections with different privilege levels are established in separate processes rather than threads or modules within a single binary instance. Additionally, minimizing the lifetime of database connections and avoiding long-lived persistent pools where mixed-privilege operations occur can reduce the window of opportunity for this credential confusion to be exploited. Regular auditing of authentication logs should also be implemented to detect anomalies indicating unexpected identity switches during connection establishment events.