# CVE-2021-20331: MongoDB C\# Driver may publish events containing authentication-related data to a command listener configured by an application

- Priority: **Routine**
- Reason: Not severe (CVSS 4.2, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2021-05-13 · Modified: 2024-09-16
- Aliases: GHSA-p9rv-qgqw-jx2w
- Record: https://cvemate.com/vulnerability/CVE-2021-20331 · JSON: https://cvemate.com/vulnerability/CVE-2021-20331/json

## Description

```text
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.
```

## Signals

- CVSS: 4.9 medium (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N
- EPSS: 0.623%, percentile 51.341%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- mongodb inc mongodb c driver: ≥ 2.12, ≤ 2.12.1
- mongodb c driver: ≥ 2.12.0, \< 2.12.2 \| 2.11.0
- NuGet MongoDB.Driver (NuGet): ≥ 2.11.0, \< 2.12.2

## References

- <https://jira.mongodb.org/browse/CSHARP-3521>
- <https://nvd.nist.gov/vuln/detail/CVE-2021-20331>
- <https://github.com/mongodb/mongo-csharp-driver/commit/1f1a526e93ed7aa254759704b19f5ee66a3af365>

---

Data as of 2026-12-05T04:36:11.087Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
