Vulnerabilities

Vulnerability · CVE-2021-32040

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…

Published Apr 12, 2022 · catalog updated Jun 17, 2026 · the affected product

Last checked Nov 1, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2021-32040. EPSS is 2.01%. Act only if a listed version of the affected product is installed.

Gaps on this record

  • No plain product name is stored. The page cannot tell you which product to check.
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.

Same product and reporting

Severity
High7.5
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
2.01%
Remediation
Version ranges on file
Affected products
cpe mongodb/mongodb

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.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • cpe mongodb/mongodb< 4.2.16
  • cpe mongodb/mongodb< 4.4.11
  • cpe mongodb/mongodb< 5.0.4

How to fix CVE-2021-32040

  • Upgrade

    CVE-2021-32040 lists a fix boundary at 4.2.16. Compare the installed build with that boundary before you change production.

  • Version check

    Affected < 4.2.16

  • Advisory

    Open the inventory_high record and follow its fix.

  • Official advisories

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2021-32040. EPSS is 2.01%. Act only if a listed version of the affected product is installed.

Which versions are affected?

Compare what you have installed with < 4.2.16, < 4.4.11, < 5.0.4. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-121: Stack-based Buffer Overflow; CWE-787: Out-of-bounds Write. EPSS 2.01%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Technology hubs

Code

The project this record applies to. Exploit listings stay in References.

No public source repository is identified for this product.

Timeline

Detection, updates, and resolution for this record.

  1. Apr 12, 2022 · Monitored products — high

    Detected

    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

  2. Jun 17, 2026 · Monitored products — high

    Updated

    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

Sources

  • Monitored products — highVendor advisoryCVE-2021-32040

    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

    nvd.nist.gov

References

Freshness

Last verified in this catalog Nov 1, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • Monitored products — highNov 1, 2026