LiveActive security incident?Get immediate response
CVE Record

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

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.

MediumCVSS 6.5Not KEV-listedUpdated
Glexia's TakeAutomated analysismoderate

Security readout for executives and security teams

Plain-English summary

CVE-2021-32040 is a MongoDB Server denial-of-service issue. A logged-in attacker who can make MongoDB run an unusually long aggregation pipeline with a specific stage could crash mongod. The business impact is service outage, not data theft or modification based on the provided sources.

Executive priority

Prioritize remediation for production MongoDB systems supporting critical services or exposed through flexible query features. This is not a confidentiality breach based on current evidence, but a reliable database crash can still create meaningful outage risk.

Technical view

The issue is a stack overflow caused by large stack frames used by a specific aggregation stage/operator when processing extremely long aggregation pipelines. It affects MongoDB Server 4.2 before 4.2.16, 4.4 through 4.4.28, and 5.0 before 5.0.4. CVSS 3.1 is 6.5: network-accessible, low complexity, low privileges, high availability impact.

Likely exposure

Exposure is most likely where untrusted or broad application users can submit or influence MongoDB aggregation pipelines. Internet exposure depends on application design; the CVE requires authenticated or otherwise privileged ability to cause the aggregation to run.

Exploitation context

The source bundle does not show CISA KEV listing or confirmed active exploitation. Exploitation requires causing a specific oversized aggregation workload, which can crash mongod under affected configurations. Treat it as an availability risk for systems where database uptime is business-critical.

Researcher notes

Evidence names the vulnerable behavior and affected version ranges, but the provided bundle does not include exploit details or proof of active exploitation. The workaround is explicitly documented for >=4.2.16 users and all 4.4 users by lowering internalPipelineLengthLimit from 1000 to 50.

Mitigation direction

  • Inventory MongoDB Server 4.2, 4.4, and 5.0 deployments.
  • Upgrade 5.0 deployments to 5.0.4 or later.
  • Upgrade 4.2 deployments to 4.2.16 or later.
  • For eligible deployments, set internalPipelineLengthLimit=50 at mongod startup.
  • Check MongoDB and downstream vendor advisories for 4.4-specific fixed-release guidance.

Validation and detection

  • Confirm exact MongoDB Server version on every deployment.
  • Review whether applications allow user-controlled aggregation pipelines.
  • Check mongod startup parameters for internalPipelineLengthLimit where used.
  • Review monitoring for unexplained mongod crashes or availability drops.
  • Verify dependent products against vendor advisories, including NetApp.
Prepared
Confidence
high
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-121: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2021-32040 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
Medium
CVSS
6.5 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
5Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
6.5CVSS 3.1MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H2.83.6Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

6.5Medium
CVSS 3.1 vector shape for CVE-2021-32040Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
MongoDB Inc.MongoDB Server5.0, 4.4, 4.2unaffected
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-121 · source CWE mapping

Stack-based Buffer Overflow

Stack-based Buffer Overflow represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.