CVE-2021-32050: Mongodb/mongodb MongoDB Driver May Publish Events Vulnerability

MODERATE
Advisory Identifier: GHSA-vxvm-qww3-2fh7
CVSS 4.2
CWE-532 CWE-200
Published
Advisory Summary

CVE-2021-32050 is a MODERATE (CVSS 4.2) mongodb driver may publish events vulnerability (CWE-532: Insertion of Sensitive Information into Log File) affecting Mongodb/mongodb libraries in the Packagist ecosystem. The issue involves mongodb driver may publish events containing authentication-related data. Remediation is available by upgrading affected packages to version 1.9.2, 3.6.10, 4.17.0, 5.8.0, 1.1.1.

CVE-2021-32050 at a Glance

CVE Identifier CVE-2021-32050
GHSA Identifier GHSA-vxvm-qww3-2fh7
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-532: Insertion of Sensitive Information into Log File
Affected Product Mongodb/mongodb
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.2

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:R/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 Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-32050

To remediate this vulnerability, upgrade all affected Mongodb/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/mongodb fixed: 1.9.2
Upgrade mongodb/mongodb to 1.9.2
mongodb fixed: 3.6.10
npm install mongodb@3.6.10
mongodb fixed: 4.17.0
npm install mongodb@4.17.0
mongodb fixed: 5.8.0
npm install mongodb@5.8.0
github.com/mongodb/mongo-swift-driver fixed: 1.1.1
Upgrade github.com/mongodb/mongo-swift-driver to 1.1.1
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/mongodb

How to Check if You Are Affected

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

inspect dependencies for mongodb/mongodb

Analyze the terminal output to locate any version of Mongodb/mongodb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.9.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-532: Insertion of Sensitive Information into Log File, where the product writes sensitive information to a log file. In Mongodb/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

Some MongoDB Drivers 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 specific authentication-related commands are executed. Without due care, an application may inadvertently expose this sensitive 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 1.0.0 prior to 1.17.7, MongoDB PHP Driver 1.0.0 prior to 1.9.2, MongoDB Swift Driver 1.0.0 prior to 1.1.1, MongoDB Node.js Driver 3.6 prior to 3.6.10, MongoDB Node.js Driver 4.0 prior to 4.17.0 and MongoDB Node.js Driver 5.0 prior to 5.8.0. This issue also affects users of the MongoDB C++ Driver dependent on the C driver 1.0.0 prior to 1.17.7 (C++ driver prior to 3.7.0).

CVE-2021-32050 Affected Mongodb/mongodb Versions

5 component(s)
Fixed Versions:
1.9.23.6.104.17.05.8.01.1.1
Product / Package Ecosystem Affected Versions Fixed Version
mongodb/mongodb
Packagist
≥ 1.0.0
< 1.9.2
1.9.2
mongodb
npm
≥ 3.6.0
< 3.6.10
3.6.10
mongodb
npm
≥ 4.0.0
< 4.17.0
4.17.0
mongodb
npm
≥ 5.0.0
< 5.8.0
5.8.0
github.com/mongodb/mongo-swift-driver
SwiftURL
≥ 1.0.0
< 1.1.1
1.1.1

References

Frequently Asked Questions

What is CVE-2021-32050?
CVE-2021-32050 is a security vulnerability in Mongodb/mongodb involving MongoDB Driver may publish events containing authentication-related data under CWE-532: Insertion of Sensitive Information into Log File.
Which Mongodb/mongodb versions are affected?
Affected versions include releases prior to 1.9.2, 3.6.10, 4.17.0, 5.8.0, 1.1.1 across affected packages: mongodb/mongodb, mongodb, github.com/mongodb/mongo-swift-driver.
What version fixes CVE-2021-32050?
Upgrading to 1.9.2, 3.6.10, 4.17.0, 5.8.0, 1.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongodb/mongodb affected?
Yes, mongodb/mongodb is affected in releases prior to 1.9.2. Upgrade your dependency to 1.9.2 or later.
Is mongodb affected?
Yes, mongodb is affected in releases prior to 3.6.10, 4.17.0, 5.8.0. Upgrade your dependency to 3.6.10, 4.17.0, 5.8.0 or later.
What is the CVSS score of CVE-2021-32050?
CVE-2021-32050 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-32050?
CVE-2021-32050 is classified under CWE-532: Insertion of Sensitive Information into Log File (The product writes sensitive information to a log file.).
How can I check Packagist dependencies for CVE-2021-32050?
Run the dependency tree command: 'inspect dependencies for mongodb/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-vxvm-qww3-2fh7",
  "modified" : "2025-11-03T21:30:53Z",
  "published" : "2023-08-29T18:31:53Z",
  "aliases" : [ "CVE-2021-32050" ],
  "summary" : "MongoDB Driver may publish events containing authentication-related data",
  "details" : "Some MongoDB Drivers 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 specific authentication-related commands are executed.\n\nWithout due care, an application may inadvertently expose this sensitive 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).\n\nThis issue affects the MongoDB C Driver 1.0.0 prior to 1.17.7, MongoDB PHP Driver 1.0.0 prior to 1.9.2, MongoDB Swift Driver 1.0.0 prior to 1.1.1, MongoDB Node.js Driver 3.6 prior to 3.6.10, MongoDB Node.js Driver 4.0 prior to 4.17.0 and MongoDB Node.js Driver 5.0 prior to 5.8.0. This issue also affects users of the MongoDB C++ Driver dependent on the C driver 1.0.0 prior to 1.17.7 (C++ driver prior to 3.7.0).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "mongodb/mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.9.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.6.0"
      }, {
        "fixed" : "3.6.10"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.17.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongodb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0"
      }, {
        "fixed" : "5.8.0"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "SwiftURL",
      "name" : "github.com/mongodb/mongo-swift-driver"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "1.1.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-32050"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-driver/pull/1235"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-swift-driver/pull/643"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/mongo-php-driver/commit/4495de8313c0d313e4dde906fc7aedf998ee3748"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/mongodb/node-mongodb-native/commit/8c8b4c3b8c55f10fb96f63d3bbfa5d408b4ed7d0"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/CDRIVER-3797"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/CXX-2028"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/NODE-3356"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/PHPC-1869"
  }, {
    "type" : "WEB",
    "url" : "https://jira.mongodb.org/browse/SWIFT-1229"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2025/05/msg00027.html"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20231006-0001"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200", "CWE-532" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-08-30T21:20:44Z",
    "nvd_published_at" : "2023-08-29T16:15:08Z"
  }
}