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 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
- Versión: 3.1
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Puntuación base: 7.5
Probabilidad de explotación (EPSS)
- Probabilidad de explotación en los próximos 30 días: 2.01%
- Percentil entre todas las CVEs puntuadas: 80
- Fecha de la puntuación: 7/10/2026
EPSS (Exploit Prediction Scoring System, de FIRST) estima la probabilidad de que una vulnerabilidad sea explotada en 30 días. Complementa a CVSS (impacto) y a CISA KEV (explotación confirmada).
Tecnologías afectadas (1)
CWE
- CWE-121
- CWE-787
Referencias
- https://jira.mongodb.org/browse/SERVER-58203
- https://jira.mongodb.org/browse/SERVER-59299
- https://jira.mongodb.org/browse/SERVER-60218
- https://security.netapp.com/advisory/ntap-20220609-0005/
- https://jira.mongodb.org/browse/SERVER-58203
- https://jira.mongodb.org/browse/SERVER-59299
- https://jira.mongodb.org/browse/SERVER-60218
- https://security.netapp.com/advisory/ntap-20220609-0005/
JSON original (NVD)
Mostrar
{
"id": "CVE-2021-32040",
"cveTags": [],
"metrics": {
"ssvcV203": [
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"ssvcData": {
"id": "CVE-2021-32040",
"role": "CISA Coordinator",
"options": [
{
"exploitation": "none"
},
{
"automatable": "no"
},
{
"technicalImpact": "partial"
}
],
"version": "2.0.3",
"timestamp": "2024-02-23T18:16:37.734248Z"
}
}
],
"cvssMetricV2": [
{
"type": "Primary",
"source": "nvd@nist.gov",
"cvssData": {
"version": "2.0",
"baseScore": 5,
"accessVector": "NETWORK",
"vectorString": "AV:N/AC:L/Au:N/C:N/I:N/A:P",
"authentication": "NONE",
"integrityImpact": "NONE",
"accessComplexity": "LOW",
"availabilityImpact": "PARTIAL",
"confidentialityImpact": "NONE"
},
"acInsufInfo": false,
"impactScore": 2.9,
"baseSeverity": "MEDIUM",
"obtainAllPrivilege": false,
"exploitabilityScore": 10,
"obtainUserPrivilege": false,
"obtainOtherPrivilege": false,
"userInteractionRequired": false
}
],
"cvssMetricV31": [
{
"type": "Secondary",
"source": "cna@mongodb.com",
"cvssData": {
"scope": "UNCHANGED",
"version": "3.1",
"baseScore": 6.5,
"attackVector": "NETWORK",
"baseSeverity": "MEDIUM",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H",
"integrityImpact": "NONE",
"userInteraction": "NONE",
"attackComplexity": "LOW",
"availabilityImpact": "HIGH",
"privilegesRequired": "LOW",
"confidentialityImpact": "NONE"
},
"impactScore": 3.6,
"exploitabilityScore": 2.8
},
{
"type": "Primary",
"source": "nvd@nist.gov",
"cvssData": {
"scope": "UNCHANGED",
"version": "3.1",
"baseScore": 7.5,
"attackVector": "NETWORK",
"baseSeverity": "HIGH",
"vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"integrityImpact": "NONE",
"userInteraction": "NONE",
"attackComplexity": "LOW",
"availabilityImpact": "HIGH",
"privilegesRequired": "NONE",
"confidentialityImpact": "NONE"
},
"impactScore": 3.6,
"exploitabilityScore": 3.9
}
]
},
"affected": [
{
"source": "cna@mongodb.com",
"affectedData": [
{
"vendor": "MongoDB Inc.",
"product": "MongoDB Server",
"versions": [
{
"status": "affected",
"version": "5.0",
"lessThan": "5.0.4",
"versionType": "custom"
},
{
"status": "affected",
"version": "4.4",
"versionType": "custom",
"lessThanOrEqual": "4.4.28"
},
{
"status": "affected",
"version": "4.2",
"lessThan": "4.2.16",
"versionType": "custom"
}
],
"defaultStatus": "unaffected"
}
]
},
{
"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
"affectedData": [
{
"cpes": [
"cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*"
],
"vendor": "mongodb",
"product": "mongodb",
"versions": [
{
"status": "affected",
"version": "5.0",
"lessThan": "5.0.4",
"versionType": "custom"
},
{
"status": "affected",
"version": "4.4",
"versionType": "custom",
"lessThanOrEqual": "4.4.28"
},
{
"status": "affected",
"version": "4.2",
"lessThan": "4.2.16",
"versionType": "custom"
}
],
"defaultStatus": "unknown"
}
]
}
],
"published": "2022-04-12T15:15:07.707",
"references": [
{
"url": "https://jira.mongodb.org/browse/SERVER-58203",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "cna@mongodb.com"
},
{
"url": "https://jira.mongodb.org/browse/SERVER-59299",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "cna@mongodb.com"
},
{
"url": "https://jira.mongodb.org/browse/SERVER-60218",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "cna@mongodb.com"
},
{
"url": "https://security.netapp.com/advisory/ntap-20220609-0005/",
"tags": [
"Third Party Advisory"
],
"source": "cna@mongodb.com"
},
{
"url": "https://jira.mongodb.org/browse/SERVER-58203",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://jira.mongodb.org/browse/SERVER-59299",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://jira.mongodb.org/browse/SERVER-60218",
"tags": [
"Issue Tracking",
"Patch",
"Vendor Advisory"
],
"source": "af854a3a-2127-422b-91ae-364da2661108"
},
{
"url": "https://security.netapp.com/advisory/ntap-20220609-0005/",
"tags": [
"Third Party Advisory"
],
"source": "af854a3a-2127-422b-91ae-364da2661108"
}
],
"vulnStatus": "Modified",
"weaknesses": [
{
"type": "Secondary",
"source": "cna@mongodb.com",
"description": [
{
"lang": "en",
"value": "CWE-121"
}
]
},
{
"type": "Primary",
"source": "nvd@nist.gov",
"description": [
{
"lang": "en",
"value": "CWE-787"
}
]
}
],
"descriptions": [
{
"lang": "en",
"value": "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.\n\nWorkaround: >= 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."
},
{
"lang": "es",
"value": "Puede ser posible tener una tubería de agregación extremadamente larga en conjunto con una etapa/operador específico y causar un desbordamiento de pila debido al tamaño de los marcos de pila usados por esa etapa. Si un atacante pudiera causar tal agregación, podría colapsar MongoDB de forma maliciosa en un ataque DoS. Esta vulnerabilidad afecta a MongoDB versiones anteriores a 5.0.4, 4.4.11 y 4.2.16"
}
],
"lastModified": "2026-06-17T03:52:43.110",
"configurations": [
{
"nodes": [
{
"negate": false,
"cpeMatch": [
{
"criteria": "cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "E9E9B009-9C50-4181-BF09-5A62CC2A69F2",
"versionEndExcluding": "4.2.16",
"versionStartIncluding": "4.2.0"
},
{
"criteria": "cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "63C08E83-4BD2-413A-BEC3-8CC895A66A1C",
"versionEndExcluding": "4.4.11",
"versionStartIncluding": "4.4.0"
},
{
"criteria": "cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*",
"vulnerable": true,
"matchCriteriaId": "F8601A2F-3061-47D5-8E27-5FEC58D25637",
"versionEndExcluding": "5.0.4",
"versionStartIncluding": "5.0.0"
}
],
"operator": "OR"
}
]
}
],
"sourceIdentifier": "cna@mongodb.com"
}