7.5

CVE-2021-32040: Large aggregation pipelines with a specific stage can crash mongod under default configuration

Modified
AliasesUBUNTU-CVE-2021-32040
Published 12-04-2022Last modified 16-09-2024

Vulnerability summary

CVE-2021-32040 is a high (CVSS 7.5) Stack-based Buffer Overflow vulnerability in mongodb inc mongodb server. EPSS estimates a 2.01% chance of exploitation in the next 30 days, higher than 81.5% of scored vulnerabilities.

Priority
Routine

Not severe (CVSS 6.5, network access); no exploitation reported by the 5 checked sources

CIRCL last checked 05-12-2026

Source freshness unavailable

How is this decided?
CVSS score
7.5/10
010
High · v3.1 (NVD)
EPSS score
2.01%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits0No public exploits recorded

Timeline

  1. 12-04-2022
    PublishedVulnerability first disclosed.
  2. 16-09-2024
    Last modifiedVulnerability information updated.

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.

CVSS metrics

4 scores · 3 sources · 2 versions

EPSS trend

Probability

2.01%

Chance of exploitation in the next 30 days

Percentile

82%

Versus all other CVEs

30-day change

No change 0.00 pp

From 2.01% on 04-11-2026

04-11-202604-12-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

0 found

No public exploits indexed.

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, low-privilege account, no user interaction (CVSS vector). Other conditions: not stated in public data.

Mongodb1 product
  • mongodb≥ 4.2.0, < 4.2.16 | ≥ 4.4.0, < 4.4.11 | ≥ 5.0.0, < 5.0.4
Mongodb inc1 product
  • mongodb server≥ 5.0, < 5.0.4 | ≥ 4.4, ≤ 4.4.28 | ≥ 4.2, < 4.2.16
Ubuntu1 product
  • mongodbAll versions (No fix recorded)

3 vendors · 3 products

References

6 links