7.5
HIGH CVSS 3.1
CVE-2021-32040
Large aggregation pipelines with a specific stage can crash mongod under default configuration
Description

It may be possible to have an extremely long aggregation pipeline in conjunction with a specific stage/operator and cause a stack overflow due to the size of the stack frames used by that stage. If an attacker could cause such an aggregation to occur, they could maliciously crash MongoDB in a DoS attack. This vulnerability affects MongoDB Server v4.4 versions prior to and including 4.4.28, MongoDB Server v5.0 versions prior to 5.0.4 and MongoDB Server v4.2 versions prior to 4.2.16. Workaround: >= v4.2.16 users and all v4.4 users can add the --setParameter internalPipelineLengthLimit=50 instead of the default 1000 to mongod at startup to prevent a crash.

INFO

Published Date :

April 12, 2022, 3:15 p.m.

Last Modified :

Nov. 21, 2024, 6:06 a.m.

Remotely Exploit :

Yes !
Affected Products

The following products are affected by CVE-2021-32040 vulnerability. Even if cvefeed.io is aware of the exact versions of the products that are affected, the information is not represented in the table below.

ID Vendor Product Action
1 Mongodb mongodb
CVSS Scores
The Common Vulnerability Scoring System is a standardized framework for assessing the severity of vulnerabilities in software and systems. We collect and displays CVSS scores from various sources for each CVE.
Score Version Severity Vector Exploitability Score Impact Score Source
CVSS 2.0 MEDIUM [email protected]
CVSS 3.1 MEDIUM [email protected]
CVSS 3.1 HIGH [email protected]
Solution
This information is provided by the 3rd party feeds.
  • There is no known solution at this time.
Public PoC/Exploit Available at Github

CVE-2021-32040 has a 1 public PoC/Exploit available at Github. Go to the Public Exploits tab to see the list.

References to Advisories, Solutions, and Tools

Here, you will find a curated list of external links that provide in-depth information, practical solutions, and valuable tools related to CVE-2021-32040.

URL Resource
https://jira.mongodb.org/browse/SERVER-58203 Issue Tracking Patch Vendor Advisory
https://jira.mongodb.org/browse/SERVER-59299 Issue Tracking Patch Vendor Advisory
https://jira.mongodb.org/browse/SERVER-60218 Issue Tracking Patch Vendor Advisory
https://security.netapp.com/advisory/ntap-20220609-0005/ Third Party Advisory
https://jira.mongodb.org/browse/SERVER-58203 Issue Tracking Patch Vendor Advisory
https://jira.mongodb.org/browse/SERVER-59299 Issue Tracking Patch Vendor Advisory
https://jira.mongodb.org/browse/SERVER-60218 Issue Tracking Patch Vendor Advisory
https://security.netapp.com/advisory/ntap-20220609-0005/ Third Party Advisory
CWE - Common Weakness Enumeration

While CVE identifies specific instances of vulnerabilities, CWE categorizes the common flaws or weaknesses that can lead to vulnerabilities. CVE-2021-32040 is associated with the following CWEs:

Common Attack Pattern Enumeration and Classification (CAPEC)

Common Attack Pattern Enumeration and Classification (CAPEC) stores attack patterns, which are descriptions of the common attributes and approaches employed by adversaries to exploit the CVE-2021-32040 weaknesses.

We scan GitHub repositories to detect new proof-of-concept exploits. Following list is a collection of public exploits and proof-of-concepts, which have been published on GitHub (sorted by the most recently updated).

Unifi Controller (DB included)

Dockerfile Shell

Updated: 1 month, 2 weeks ago
19 stars 1 fork 1 watcher
Born at : March 11, 2018, 2:36 p.m. This repo has been linked 32 different CVEs too.

Results are limited to the first 15 repositories due to potential performance issues.

The following list is the news that have been mention CVE-2021-32040 vulnerability anywhere in the article.

The following table lists the changes that have been made to the CVE-2021-32040 vulnerability over time.

Vulnerability history details can be useful for understanding the evolution of a vulnerability, and for identifying the most recent changes that may impact the vulnerability's severity, exploitability, or other characteristics.

  • CVE Modified by af854a3a-2127-422b-91ae-364da2661108

    Nov. 21, 2024

    Action Type Old Value New Value
    Added Reference https://jira.mongodb.org/browse/SERVER-58203
    Added Reference https://jira.mongodb.org/browse/SERVER-59299
    Added Reference https://jira.mongodb.org/browse/SERVER-60218
    Added Reference https://security.netapp.com/advisory/ntap-20220609-0005/
  • CVE Modified by [email protected]

    Sep. 16, 2024

    Action Type Old Value New Value
    Changed Description It may be possible to have an extremely long aggregation pipeline in conjunction with a specific stage/operator and cause a stack overflow due to the size of the stack frames used by that stage. If an attacker could cause such an aggregation to occur, they could maliciously crash MongoDB in a DoS attack. This vulnerability affects MongoDB Server v4.4 versions prior to and including 4.4.28, MongoDB Server v5.0 versions prior to 5.0.4 and MongoDB Server v4.2 versions prior to 4.2.16. Workaround: >= v4.2.16 users and all v4.4 users can add the --setParameter internalPipelineLengthLimit=50 instead of the default 1000 to mongod at startup to prevent a crash. It may be possible to have an extremely long aggregation pipeline in conjunction with a specific stage/operator and cause a stack overflow due to the size of the stack frames used by that stage. If an attacker could cause such an aggregation to occur, they could maliciously crash MongoDB in a DoS attack. This vulnerability affects MongoDB Server v4.4 versions prior to and including 4.4.28, MongoDB Server v5.0 versions prior to 5.0.4 and MongoDB Server v4.2 versions prior to 4.2.16. Workaround: >= v4.2.16 users and all v4.4 users can add the --setParameter internalPipelineLengthLimit=50 instead of the default 1000 to mongod at startup to prevent a crash.
  • CVE Modified by [email protected]

    May. 14, 2024

    Action Type Old Value New Value
  • CVE Modified by [email protected]

    Feb. 23, 2024

    Action Type Old Value New Value
    Changed Description It may be possible to have an extremely long aggregation pipeline in conjunction with a specific stage/operator and cause a stack overflow due to the size of the stack frames used by that stage. If an attacker could cause such an aggregation to occur, they could maliciously crash MongoDB in a DoS attack. This vulnerability affects MongoDB versions prior to 5.0.4, 4.4.11, 4.2.16. It may be possible to have an extremely long aggregation pipeline in conjunction with a specific stage/operator and cause a stack overflow due to the size of the stack frames used by that stage. If an attacker could cause such an aggregation to occur, they could maliciously crash MongoDB in a DoS attack. This vulnerability affects MongoDB Server v4.4 versions prior to and including 4.4.28, MongoDB Server v5.0 versions prior to 5.0.4 and MongoDB Server v4.2 versions prior to 4.2.16. Workaround: >= v4.2.16 users and all v4.4 users can add the --setParameter internalPipelineLengthLimit=50 instead of the default 1000 to mongod at startup to prevent a crash.
  • Modified Analysis by [email protected]

    Feb. 03, 2023

    Action Type Old Value New Value
    Changed Reference Type https://security.netapp.com/advisory/ntap-20220609-0005/ No Types Assigned https://security.netapp.com/advisory/ntap-20220609-0005/ Third Party Advisory
  • CVE Modified by [email protected]

    Jun. 09, 2022

    Action Type Old Value New Value
    Added Reference https://security.netapp.com/advisory/ntap-20220609-0005/ [No Types Assigned]
  • Initial Analysis by [email protected]

    Apr. 20, 2022

    Action Type Old Value New Value
    Added CVSS V2 NIST (AV:N/AC:L/Au:N/C:N/I:N/A:P)
    Added CVSS V3.1 NIST AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
    Changed Reference Type https://jira.mongodb.org/browse/SERVER-58203 No Types Assigned https://jira.mongodb.org/browse/SERVER-58203 Issue Tracking, Patch, Vendor Advisory
    Changed Reference Type https://jira.mongodb.org/browse/SERVER-59299 No Types Assigned https://jira.mongodb.org/browse/SERVER-59299 Issue Tracking, Patch, Vendor Advisory
    Changed Reference Type https://jira.mongodb.org/browse/SERVER-60218 No Types Assigned https://jira.mongodb.org/browse/SERVER-60218 Issue Tracking, Patch, Vendor Advisory
    Added CWE NIST CWE-787
    Added CPE Configuration OR *cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:* versions from (including) 4.2.0 up to (excluding) 4.2.16 *cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:* versions from (including) 4.4.0 up to (excluding) 4.4.11 *cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:* versions from (including) 5.0.0 up to (excluding) 5.0.4
EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days. Following chart shows the EPSS score history of the vulnerability.
Vulnerability Scoring Details
Base CVSS Score: 7.5
Attack Vector
Attack Complexity
Privileges Required
User Interaction
Scope
Confidentiality Impact
Integrity Impact
Availability Impact
Base CVSS Score: 5
Access Vector
Access Complexity
Authentication
Confidentiality Impact
Integrity Impact
Availability Impact
Exploit Prediction

EPSS is a daily estimate of the probability of exploitation activity being observed over the next 30 days.

0.62 }} 0.02%

score

0.68997

percentile