CVE-2021-20332: Mongodb Exposure Of Sensitive Information To Vulnerability

MODERATE
Advisory Identifier: GHSA-4rjr-3gj2-5crq
CVSS 4.4
CWE-200
Published
Advisory Summary

CVE-2021-20332 is a MODERATE (CVSS 4.4) exposure of sensitive information to vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Mongodb libraries in the crates.io ecosystem. The issue involves exposure of sensitive information to an unauthorized actor in mongodb rust driver. Remediation is available by upgrading affected packages to version 2.0.0-beta.

CVE-2021-20332 at a Glance

CVE Identifier CVE-2021-20332
GHSA Identifier GHSA-4rjr-3gj2-5crq
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Mongodb
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 4.4

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-20332

To remediate this vulnerability, upgrade all affected Mongodb dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mongodb fixed: 2.0.0-beta
Upgrade mongodb to 2.0.0-beta
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for mongodb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2021-20332, inspect your project dependencies for Mongodb:

inspect dependencies for mongodb

Analyze the terminal output to locate any version of Mongodb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0-beta), 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, 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

Specific MongoDB Rust Driver versions can include credentials used by the connection pool to authenticate connections in the monitoring event that is emitted when the pool is created. The user's logging infrastructure could then potentially ingest these events and unexpectedly leak the credentials. Note that such monitoring is not enabled by default.

CVE-2021-20332 Affected Mongodb Versions

1 component(s)
Fixed Versions:
2.0.0-beta
Product / Package Ecosystem Affected Versions Fixed Version
mongodb
crates.io
≥ 1.0.0
< 2.0.0-beta
2.0.0-beta

References

Frequently Asked Questions

What is CVE-2021-20332?
CVE-2021-20332 is a security vulnerability in Mongodb involving Exposure of Sensitive Information to an Unauthorized Actor in MongoDB Rust Driver under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Mongodb versions are affected?
Affected versions include releases prior to 2.0.0-beta across affected packages: mongodb.
What version fixes CVE-2021-20332?
Upgrading to 2.0.0-beta (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongodb affected?
Yes, mongodb is affected in releases prior to 2.0.0-beta. Upgrade your dependency to 2.0.0-beta or later.
What is the CVSS score of CVE-2021-20332?
CVE-2021-20332 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-20332?
CVE-2021-20332 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check crates.io dependencies for CVE-2021-20332?
Run the dependency tree command: 'inspect dependencies for mongodb'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4rjr-3gj2-5crq",
  "modified" : "2022-06-17T21:39:29Z",
  "published" : "2022-05-24T19:09:36Z",
  "aliases" : [ "CVE-2021-20332" ],
  "summary" : "Exposure of Sensitive Information to an Unauthorized Actor in MongoDB Rust Driver",
  "details" : "Specific MongoDB Rust Driver versions can include credentials used by the connection pool to authenticate connections in the monitoring event that is emitted when the pool is created. The user's logging infrastructure could then potentially ingest these events and unexpectedly leak the credentials. Note that such monitoring is not enabled by default.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.0.0-beta"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.0-alpha1"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-20332"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-rust-driver/commit/9e8782b1bb1104e5399c073b553719c262d4463c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongodb/mongo-rust-driver"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/RUST-591"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-06-17T21:39:29Z",
    "nvd_published_at" : "2021-08-02T13:15:00Z"
  }
}