{"api_version":"1","generated_at":"2026-07-24T00:32:35+00:00","cve":"CVE-2021-32040","urls":{"html":"https://cve.report/CVE-2021-32040","api":"https://cve.report/api/cve/CVE-2021-32040.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2021-32040","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2021-32040"},"summary":{"title":"CVE-2021-32040","description":"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 versions prior to 5.0.4, 4.4.11, 4.2.16.","state":"PUBLIC","assigner":"cna@mongodb.com","published_at":"2022-04-12 15:15:00","updated_at":"2023-02-03 19:13:00"},"problem_types":["CWE-787"],"metrics":[],"references":[{"url":"https://jira.mongodb.org/browse/SERVER-59299","name":"https://jira.mongodb.org/browse/SERVER-59299","refsource":"MISC","tags":[],"title":"[SERVER-59299] Improve $match stage - MongoDB Jira","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://jira.mongodb.org/browse/SERVER-60218","name":"https://jira.mongodb.org/browse/SERVER-60218","refsource":"MISC","tags":[],"title":"[SERVER-60218] Improve $group stage - MongoDB Jira","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://jira.mongodb.org/browse/SERVER-58203","name":"https://jira.mongodb.org/browse/SERVER-58203","refsource":"MISC","tags":[],"title":"[SERVER-58203] improve $unionWith stage - MongoDB Jira","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://security.netapp.com/advisory/ntap-20220609-0005/","name":"https://security.netapp.com/advisory/ntap-20220609-0005/","refsource":"CONFIRM","tags":[],"title":"CVE-2021-32040 MongoDB Vulnerability in NetApp Products | NetApp Product Security","mime":"text/html","httpstatus":"200","archivestatus":"404"},{"url":"https://www.cve.org/CVERecord?id=CVE-2021-32040","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32040","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[{"cve_year":"2021","cve_id":"32040","vulnerable":"1","versionEndIncluding":"","cpe1":"cpe","cpe2":"2.3","cpe3":"a","cpe4":"mongodb","cpe5":"mongodb","cpe6":"*","cpe7":"*","cpe8":"*","cpe9":"*","cpe10":"*","cpe11":"*","cpe12":"*","cpe13":"*"}],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"CVE_data_meta":{"ASSIGNER":"cna@mongodb.com","DATE_PUBLIC":"2022-04-12T20:00:00.000Z","ID":"CVE-2021-32040","STATE":"PUBLIC","TITLE":"Large aggregation pipelines with a specific stage can crash mongod under default configuration"},"affects":{"vendor":{"vendor_data":[{"product":{"product_data":[{"product_name":"MongoDB Server","version":{"version_data":[{"version_affected":"<","version_name":"5.0","version_value":"5.0.4"},{"version_affected":"<","version_name":"4.4","version_value":"4.4.11"},{"version_affected":"<","version_name":"4.2","version_value":"4.2.16"}]}}]},"vendor_name":"MongoDB Inc."}]}},"data_format":"MITRE","data_type":"CVE","data_version":"4.0","description":{"description_data":[{"lang":"eng","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 versions prior to 5.0.4, 4.4.11, 4.2.16."}]},"generator":{"engine":"Vulnogram 0.0.9"},"impact":{"cvss":{"attackComplexity":"LOW","attackVector":"NETWORK","availabilityImpact":"HIGH","baseScore":6.5,"baseSeverity":"MEDIUM","confidentialityImpact":"NONE","integrityImpact":"NONE","privilegesRequired":"LOW","scope":"UNCHANGED","userInteraction":"NONE","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","version":"3.1"}},"problemtype":{"problemtype_data":[{"description":[{"lang":"eng","value":"CWE-121 Stack-based Buffer Overflow"}]}]},"references":{"reference_data":[{"refsource":"MISC","url":"https://jira.mongodb.org/browse/SERVER-58203","name":"https://jira.mongodb.org/browse/SERVER-58203"},{"refsource":"MISC","url":"https://jira.mongodb.org/browse/SERVER-59299","name":"https://jira.mongodb.org/browse/SERVER-59299"},{"refsource":"MISC","url":"https://jira.mongodb.org/browse/SERVER-60218","name":"https://jira.mongodb.org/browse/SERVER-60218"},{"refsource":"CONFIRM","name":"https://security.netapp.com/advisory/ntap-20220609-0005/","url":"https://security.netapp.com/advisory/ntap-20220609-0005/"}]},"source":{"discovery":"EXTERNAL"},"work_around":[{"lang":"eng","value":">=4.2.16 users can add the --setParameter internalPipelineLengthLimit=50 instead of the default 1000 to mongod at startup to prevent a crash."}]},"nvd":{"publishedDate":"2022-04-12 15:15:00","lastModifiedDate":"2023-02-03 19:13:00","problem_types":["CWE-787"],"metrics":{"baseMetricV3":{"cvssV3":{"version":"3.1","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"HIGH","baseScore":7.5,"baseSeverity":"HIGH"},"exploitabilityScore":3.9,"impactScore":3.6},"baseMetricV2":{"cvssV2":{"version":"2.0","vectorString":"AV:N/AC:L/Au:N/C:N/I:N/A:P","accessVector":"NETWORK","accessComplexity":"LOW","authentication":"NONE","confidentialityImpact":"NONE","integrityImpact":"NONE","availabilityImpact":"PARTIAL","baseScore":5},"severity":"MEDIUM","exploitabilityScore":10,"impactScore":2.9,"acInsufInfo":false,"obtainAllPrivilege":false,"obtainUserPrivilege":false,"obtainOtherPrivilege":false,"userInteractionRequired":false}},"configurations":{"CVE_data_version":"4.0","nodes":[{"operator":"OR","children":[],"cpe_match":[{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*","versionStartIncluding":"5.0.0","versionEndExcluding":"5.0.4","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*","versionStartIncluding":"4.4.0","versionEndExcluding":"4.4.11","cpe_name":[]},{"vulnerable":true,"cpe23Uri":"cpe:2.3:a:mongodb:mongodb:*:*:*:*:*:*:*:*","versionStartIncluding":"4.2.0","versionEndExcluding":"4.2.16","cpe_name":[]}]}]}},"legacy_mitre":{"record":{"CveYear":"2021","CveId":"32040","Ordinal":"207387","Title":"CVE-2021-32040","CVE":"CVE-2021-32040","Year":"2021"},"notes":[{"CveYear":"2021","CveId":"32040","Ordinal":"1","NoteData":"** RESERVED ** This candidate has been reserved by an organization or individual that will use it when announcing a new security problem. When the candidate has been publicized, the details for this candidate will be provided.","Type":"Description","Title":null}]}}}