CVE-2021-20332 Exposure of Sensitive Information to an Unauthorized Actor in MongoDB Rust Driver
The MongoDB Rust Driver may leak authentication credentials to monitoring logs if connection pool event listeners are enabled.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2021-20332?
CVE-2021-20332 is a medium-severity vulnerability in MongoDB Rust Driver, published on 2 Aug 2021. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Specific MongoDB Rust Driver versions can include credentials used by the connection pool to authenticate connections in the monitoring event that is emitted when the pool is created. The user's logging infrastructure could then potentially ingest these events and unexpectedly leak the credentials. Note that such monitoring is not enabled by default. This issue affects MongoDB Rust Driver version 2.0.0-alpha, MongoDB Rust Driver version 2.0.0-alpha1 and MongoDB Rust Driver version 1.0.0 through to and including 1.2.1
Weakness: CWE-200
Which versions are affected by CVE-2021-20332?
2 open source packages ship an affected version, including mongodb. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mongodb crates.io | From 1.0.0 | 2.0.0-beta |
mongodb crates.io | From 1.0.0 | 2.0.0-beta |
Products include Mongodb Rust Driver.
How do I fix CVE-2021-20332?
Upgrade mongodb to 2.0.0-beta or later.
Is CVE-2021-20332 being exploited?
There is no known exploitation of CVE-2021-20332 in the wild and no public exploit code.
Other vulnerabilities in MongoDB Rust Driver
- CVE-2025-11695 Configuration may unexpectedly disable certificate validation
- CVE-2026-81526 Cross-database write redirection via unvalidated dotted database name in bulk write namespaces
- CVE-2024-6382 Adversarial unsanitized input may cause MongoDB Rust Driver to issue unintended commands.
- CVE-2026-88024 GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB Rust Driver
Sources
Also known as GHSA-4rjr-3gj2-5crq.