cve.bz

CVE-2021-32040 mongodb mongodb: Out-of-bounds Write

7.5 highEPSS 2.0%Fix available

High (7.5) in mongodb mongodb. EPSS 2.0% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
2.0% (unchanged from 2.0% a week ago; 2.0% 30 days ago) estimated probability of exploitation activity in the next 30 days; 81st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-02-23. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-787 Out-of-bounds Write
CWE-121 Stack-based Buffer Overflow
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-32040 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-32040?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-32040?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-32040 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
MongoDB Inc. MongoDB Serverfrom 5.0 before 5.0.4
MongoDB Inc. MongoDB Serverfrom 4.4 through 4.4.28
MongoDB Inc. MongoDB Serverfrom 4.2 before 4.2.16

Linux distributions

DistributionReleasePackageFixed inAdvisory
UbuntuPro:14.04:LTS, Pro:16.04:LTS, Pro:18.04:LTS and 1 moremongodbno fix listedUBUNTU-CVE-2021-32040

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Openshift Data Foundation 4noobaa-core-containerOut of support scope
Red Hat Openshift Data Foundation 4odf4/mcg-core-rhel9Out of support scope
Red Hat Satellite 6mongodbNot affected
Red Hat Update Infrastructure 3 for Cloud ProvidersmongodbWill not fix

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-32040.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-26-218-01ABB Ability Zenon2026-07-30Chemical, Communications, Critical Manufacturing, Dams, Energy, Healthcare and Public Health, Information Technology, Water and WastewaterIIoT services with MongoDB 4.2 installed on ABB Ability Zenon /allnone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

References

Check your stackJSON