CVE-2021-23372: Mongo express Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-m2r3-8492-vx59
CVSS 4.4
CWE-754
Published
Advisory Summary

CVE-2021-23372 is a MODERATE (CVSS 4.4) denial of service vulnerability (CWE-754: Improper Check for Unusual or Exceptional Conditions) affecting Mongo express libraries in the npm ecosystem. The issue involves denial of service (dos) in mongo-express. Remediation is available in the latest vendor maintenance releases.

CVE-2021-23372 at a Glance

CVE Identifier CVE-2021-23372
GHSA Identifier GHSA-m2r3-8492-vx59
Severity MODERATE
CVSS v3.1 Base Score 4.4
CWE Classification CWE-754: Improper Check for Unusual or Exceptional Conditions
Affected Product Mongo express
Package Ecosystem npm
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:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2021-23372

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

mongo-express fixed: Latest secure release
npm install mongo-express@Latest secure release
Verify Direct and Transitive Dependencies

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

npm ls mongo-express

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-23372, inspect your project dependencies using npm:

npm ls mongo-express

Analyze the terminal output to locate any version of Mongo express in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: The npm ls mongo-express command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions, where the product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product. In Mongo express, 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

All versions of package mongo-express are vulnerable to Denial of Service (DoS) when exporting an empty collection as CSV, due to an unhandled exception, leading to a crash.

CVE-2021-23372 Affected Mongo express Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
mongo-express
npm
≤ 0.54.0

References

Frequently Asked Questions

What is CVE-2021-23372?
CVE-2021-23372 is a security vulnerability in Mongo express involving Denial of Service (DoS) in mongo-express under CWE-754: Improper Check for Unusual or Exceptional Conditions.
Which Mongo express versions are affected?
Affected versions include releases prior to current release patches across affected packages: mongo-express.
What version fixes CVE-2021-23372?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is mongo-express affected?
Yes, mongo-express is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2021-23372?
CVE-2021-23372 has a CVSS v3.1 base score of 4.4 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2021-23372?
CVE-2021-23372 is classified under CWE-754: Improper Check for Unusual or Exceptional Conditions (The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.).
How can I check npm dependencies for CVE-2021-23372?
Run the dependency tree command: 'npm ls mongo-express'. 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-m2r3-8492-vx59",
  "modified" : "2021-10-06T15:13:57Z",
  "published" : "2021-10-06T17:47:46Z",
  "aliases" : [ "CVE-2021-23372" ],
  "summary" : "Denial of Service (DoS) in mongo-express",
  "details" : "All versions of package mongo-express are vulnerable to Denial of Service (DoS) when exporting an empty collection as CSV, due to an unhandled exception, leading to a crash.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "mongo-express"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "0.54.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23372"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/mongo-express/mongo-express"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-MONGOEXPRESS-1085403"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-754" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-10-06T15:13:57Z",
    "nvd_published_at" : "2021-04-13T20:15:00Z"
  }
}