Advisory Database
  • Advisories
  • Dependency Scanning
  1. nuget
  2. ›
  3. MongoDB.Driver
  4. ›
  5. CVE-2021-20331

CVE-2021-20331: Exposure of Sensitive Information to an Unauthorized Actor

May 24, 2022 (updated December 20, 2023)

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 2.12 <= 2.12.1.

References

  • github.com/advisories/GHSA-p9rv-qgqw-jx2w
  • github.com/mongodb/mongo-csharp-driver/commit/1f1a526e93ed7aa254759704b19f5ee66a3af365
  • jira.mongodb.org/browse/CSHARP-3521
  • nvd.nist.gov/vuln/detail/CVE-2021-20331

Code Behaviors & Features

Detect and mitigate CVE-2021-20331 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 2.11.0 before 2.12.2

Fixed versions

  • 2.12.2

Solution

Upgrade to version 2.12.2 or above.

Impact 4.9 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Source file

nuget/MongoDB.Driver/CVE-2021-20331.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:57 +0000.