CVE-2021-20331
MEDIUM 4.9CVSS 3.1MongoDB C# Driver Risk of Exposing Authentication Data via Command Listener
Specific versions of the MongoDB C# Driver may erroneously publish events containing authentication-related data to a command listener configured by an application. The published events may contain security-sensitive data when commands such as "saslStart", "saslContinue", "isMaster", "createUser", and "updateUser" are executed. Without due care, an application may inadvertently expose this authenticated-related information, e.g., by writing it to a log file. This issue only arises if an application enables the command listener feature (this is not enabled by default). This issue affects the MongoDB C# Driver v2.12 versions prior to and including 2.12.1.
- Published
- 13 May 2021
- Last modified
- 17 Jun 2026
- Assigned by
- cna@mongodb.com
- NVD status
- Modified
- Weakness
- CWE-200
- Also known as
- GHSA-p9rv-qgqw-jx2w
- Sources
- NVDJSONOSV GHSA-p9rv-qgqw-jx2wJSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | MEDIUM 4.9 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
| OSV | GitHub | CVSS 3.1 | MEDIUM 4.9 | CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N |
| NVD | cna@mongodb.com (Secondary) | CVSS 3.1 | MEDIUM 4.2 | CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | LOW 3.5 | AV:N/AC:M/Au:S/C:P/I:N/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | mongodb | c#_drivercpe:2.3:a:mongodb:c\#_driver:*:*:*:*:*:mongodb:*:* |
>= 2.12.0, < 2.12.2 | 2.12.2 |
| NVD | mongodb | c#_drivercpe:2.3:a:mongodb:c\#_driver:2.11.0:-:*:*:*:mongodb:*:* |
= 2.11.0 | |
| OSV | NuGet | mongodb.driver | >= 2.11.0, < 2.12.2 | 2.12.2 |
References
- https://jira.mongodb.org/browse/CSHARP-3521 · Issue Tracking, Patch, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2021-20331 · ADVISORY
- https://github.com/mongodb/mongo-csharp-driver/commit/1f1a526e93ed7aa254759704b19f5ee66a3af365 · WEB
History
- 25 Nov 2026 20:33 UTC · NVD: first stored (published 13 May 2021)
- 25 Nov 2026 20:13 UTC · OSV: first stored (published 24 May 2022)