Skip to content

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

HighCVSS 7.5 EPSS 2.0%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
No known exploitation · automatable: no · technical impact: partial
Technology
Ubuntu

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 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.

Upgrade path

6 packages: 2 fixed, 4 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/mongodb(Ubuntu Pro 14.04) = 1:2.4.6-0ubuntu5; = 1:2.4.6-0ubuntu6; = 1:2.4.8-1ubuntu1; = 1:2.4.8-2 +5 more No fix listed No fix yet
ubuntu/mongodb(Ubuntu Pro 16.04) = 1:2.6.10-0ubuntu1; = 1:2.6.10-0ubuntu1+esm2; All versions No fix listed No fix yet
ubuntu/mongodb(Ubuntu Pro 18.04) = 1:3.4.7-1; = 1:3.4.7-1ubuntu1; = 1:3.4.7-1ubuntu2; = 1:3.4.7-1ubuntu4 +9 more No fix listed No fix yet
ubuntu/mongodb(Ubuntu Pro 20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu2; = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5; = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.2; = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 +2 more No fix listed No fix yet
MongoDB Server >= 4.2, < 4.2.16; >= 4.4, <= 4.4.28; >= 5.0, < 5.0.4 4.2.16, 5.0.4 Fixed
mongodb/mongodb >= 4.2, < 4.2.16; >= 4.2.0, < 4.2.16; >= 4.4, <= 4.4.28; >= 4.4.0, < 4.4.11 +2 more 4.2.16, 4.4.11, 5.0.4 Fixed

Affected products

ProductAffected versionsFixed in
mongodb/mongodb >= 4.2.0, < 4.2.16 4.2.16
mongodb/mongodb >= 4.4.0, < 4.4.11 4.4.11
mongodb/mongodb >= 5.0.0, < 5.0.4 5.0.4
MongoDB Server >= 5.0, < 5.0.4 5.0.4
MongoDB Server >= 4.4, <= 4.4.28 No fix listed
MongoDB Server >= 4.2, < 4.2.16 4.2.16
mongodb/mongodb >= 5.0, < 5.0.4 5.0.4
mongodb/mongodb >= 4.4, <= 4.4.28 No fix listed
mongodb/mongodb >= 4.2, < 4.2.16 4.2.16
ubuntu/mongodb(Ubuntu:Pro:14.04) All versions No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.6-0ubuntu5 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.6-0ubuntu6 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.8-1ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.8-2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.9-1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.9-1ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.9-1ubuntu2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:14.04) = 1:2.4.9-1ubuntu2+esm2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:16.04) All versions No fix listed
ubuntu/mongodb(Ubuntu:Pro:16.04) = 1:2.6.10-0ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:16.04) = 1:2.6.10-0ubuntu1+esm2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) All versions No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.7-1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.7-1ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.7-1ubuntu2 No fix listed
Show 15 more
ProductAffected versionsFixed in
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.7-1ubuntu4 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.14-3ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.4.14-3ubuntu2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1.1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1.3 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1.4 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1.4+esm1 No fix listed
ubuntu/mongodb(Ubuntu:Pro:18.04) = 1:3.6.3-0ubuntu1.4+esm2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) All versions No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5 No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.2 No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3 No fix listed
ubuntu/mongodb(Ubuntu:Pro:20.04) = 1:3.6.9+really3.6.8+90~g8e540c0b6d-0ubuntu5.3+esm1 No fix listed

References