Medium severity · published May 13, 2021
CVE-2021-20331
Specific versions of the MongoDB C# Driver may erroneously publish events containing authentication-related data to a command listener configured by an application
4.9
CVSS
0.6%
EPSS
No
On KEV
Description
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.
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
Attack vector
Network
Complexity
Low
Privileges
High
User interaction
None
Confidentiality
High
Integrity
None
Availability
None
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.6% · higher than 50% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
CD
C# Driver · Mongodb
2.12.0 before 2.12.2; 2.11.0 · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2021-20331
CVE.org
https://www.cve.org/CVERecord?id=CVE-2021-20331
Issue Tracking
https://jira.mongodb.org/browse/CSHARP-3521
More from C# Driver
8.3
CVE-2026-88036
GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB C Driver
8.3
CVE-2026-88034
GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB C++ Driver
8.3
CVE-2026-88025
GridFS data disclosure and deletion via query-operator injection in file IDs in the MongoDB C# Driver
8.1
CVE-2026-93393
Heap overflow via oversized decrypted TLS record sequence in Windows Secure Channel stream
8.1
CVE-2026-81522
Cross-tenant database retargeting via dot/NUL injection in namespace strings in the C++ Driver
