{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-32040","id":"CVE-2021-32040","title":"Large aggregation pipelines with a specific stage can crash mongod under default configuration","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 Server v4.4 versions prior to and including 4.4.28, MongoDB","descriptionLong":"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.","published":"2022-04-12T14:15:16.692Z","updated":"2026-10-24T14:18:04.008369716Z","reserved":"2021-05-05T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"mongodb","metric":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"mongodb"},"metrics":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"mongodb"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","rating":"medium","source":"mongodb.com"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","rating":"high","source":"OSV"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","rating":"medium","source":"NVD"}],"rating":"medium","products":["MongoDB Inc. MongoDB Server"],"affectedProducts":[{"vendor":"MongoDB Inc.","product":"MongoDB Server","defaultStatus":"unaffected","versions":[{"lessThan":"5.0.4","status":"affected","version":"5.0","versionType":"custom"},{"lessThanOrEqual":"4.4.28","status":"affected","version":"4.4","versionType":"custom"},{"lessThan":"4.2.16","status":"affected","version":"4.2","versionType":"custom"}],"platforms":[]}],"packages":[],"cwes":["CWE-121","CWE-787"],"aliases":["BIT-mongodb-2021-32040"],"references":[{"url":"https://jira.mongodb.org/browse/SERVER-58203","tags":["x_refsource_MISC","x_transferred","Issue Tracking","Patch","Vendor Advisory","fix"]},{"url":"https://jira.mongodb.org/browse/SERVER-59299","tags":["x_refsource_MISC","x_transferred","Issue Tracking","Patch","Vendor Advisory","fix"]},{"url":"https://jira.mongodb.org/browse/SERVER-60218","tags":["x_refsource_MISC","x_transferred","Issue Tracking","Patch","Vendor Advisory","fix"]},{"url":"https://security.netapp.com/advisory/ntap-20220609-0005/","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.02011,"epssPercentile":0.81297,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-32040","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32040","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-32040","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-32040","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":["mongodb"],"critical":[],"attention":null}