Executive brief
libmongoc is the C driver used by MongoDB client applications to authenticate and communicate with MongoDB databases. A flaw in SCRAM authentication validation allows an attacker positioned between the client and server to inject a crafted authentication message, causing the client to proceed with authentication despite a nonce mismatch. An attacker could capture the resulting client proof and perform offline password cracking, though this risk is mitigated by TLS encryption commonly used in production.
Technical details
The vulnerability is a nonce validation bypass in libmongoc's SCRAM (Salted Challenge Response Authentication Mechanism) implementation. The client fails to properly validate the server's nonce in the server-first-message during authentication handshake; when a mismatch is detected, the client continues the handshake and transmits the client proof instead of terminating the exchange. An attacker in a man-in-the-middle position can inject a crafted server-first-message with a controlled salt and low iteration count, then capture the resulting client proof for offline password cracking. The attack requires network access to the authentication channel and is mitigated in deployments using TLS, which protects the authentication exchange from tampering.
Affected products
- MongoDB libmongoc
Timeline
- 2026-09-17: disclosed