Skip to content
Fencer Vulns
medium 6.5

CVE-2021-32040 json

Large aggregation pipelines with a specific stage can crash mongod under default configuration

published 2022-04-12 4 y ago modified 2026-09-08 2 mo ago also BIT-mongodb-2021-32040 , EUVD-2021-18906

cvss
6.5
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
2.0%
EPSS 2.0% chance of exploitation in 30 days, percentile 81%
public exploits
0
none known

Summary

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.

Patch / fix

  • bitnami mongodb 4.2.16, 4.4.11, 5.0.4
  • MongoDB Inc. MongoDB Server 4.2.16, 5.0.4
  • mongodb mongodb 4.2.16, 5.0.4

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2021-32040 updated cvss 7.5

mongodb: Pipeline Stack-based Overflow

  • Red Hat Openshift Data Foundation 4 odf4/mcg-core-rhel9, noobaa-core-container
    affected: no fix planned “Out of support scope”
  • Red Hat Update Infrastructure 3 for Cloud Providers mongodb
    affected: no fix planned “Will not fix”
  • Red Hat Satellite 6 mongodb, libmongodb, mongodb-server
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

cisa ICSA-26-218-01 updated cvss 7.5

ABB Ability Zenon

  • ABB Ability Zenon /all IIoT services with MongoDB 4.2
    affected: mitigation

Facts from CISA's republication of the vendor's own advisory (CSAF); the linked advisory is the authoritative source. CISA notification · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
partial
Assessed
2 y ago

Exploit prediction

2.01% chance of exploitation in the next 30 days, higher than 81% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CNA 3.1 6.5 CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD 2.0 5.0 AV:N/AC:L/Au:N/C:N/I:N/A:P
OSV 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected packages

ecosystem package affected fixed in
bitnami mongodb
>=4.2.0, <4.2.16
>=4.4.0, <4.4.11
>=5.0.0, <5.0.4
4.2.16
4.4.11
5.0.4

Affected products

  • MongoDB Inc. MongoDB Server
  • mongodb mongodb

Classification

Weakness
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.