Vulnerabilities in pkg:nuget/mongodb.driver
PACKAGECVE-2021-20331 is a MODERATE (CVSS 4.9) mongodb c# driver risk of vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Mongodb.driver libraries in the NuGet ecosystem. The issue involves mongodb c# driver risk of exposing authentication data via command listener. Remediation is available by upgrading affected packages to version 2.12.2.
pkg:nuget/mongodb.driver
Vulnerability advisories affecting package pkg:nuget/mongodb.driver. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-p9rv-qgqw-jx2w | CVE-2021-20331 | MODERATE | MongoDB C# Driver Risk of Exposing Authentication Data via Command Listener |
CVE-2021-20331 at a Glance
Security Impact
CVSS: 4.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2021-20331
To remediate this vulnerability, upgrade all affected Mongodb.driver dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade mongodb.driver to 2.12.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for mongodb.driver
How to Check if You Are Affected
To determine whether your application is affected by CVE-2021-20331, inspect your project dependencies for Mongodb.driver:
inspect dependencies for mongodb.driver
Analyze the terminal output to locate any version of Mongodb.driver in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.12.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Mongodb.driver, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-20331 Affected Mongodb.driver Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
mongodb.driver
|
NuGet |
≥ 2.11.0
< 2.12.2
|
2.12.2
|
References
Frequently Asked Questions
What is CVE-2021-20331?
Which Mongodb.driver versions are affected?
What version fixes CVE-2021-20331?
Is mongodb.driver affected?
What is the CVSS score of CVE-2021-20331?
What CWE is associated with CVE-2021-20331?
How can I check NuGet dependencies for CVE-2021-20331?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-p9rv-qgqw-jx2w",
"modified" : "2024-01-23T18:44:22Z",
"published" : "2022-05-24T19:02:24Z",
"aliases" : [ "CVE-2021-20331" ],
"summary" : "MongoDB C# Driver Risk of Exposing Authentication Data via Command Listener",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "NuGet",
"name" : "mongodb.driver"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.11.0"
}, {
"fixed" : "2.12.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-20331"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-csharp-driver/commit/1f1a526e93ed7aa254759704b19f5ee66a3af365"
}, {
"type" : "WEB",
"url" : "https://jira.mongodb.org/browse/CSHARP-3521"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-12-20T20:26:56Z",
"nvd_published_at" : "2021-05-13T08:15:00Z"
}
}