7.5
CWE
787 121
Advisory Published
Updated

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

First published: Tue Apr 12 2022(Updated: )

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.

Credit: cna@mongodb.com cna@mongodb.com

Affected SoftwareAffected VersionHow to fix
MongoDB MongoDB>=4.2.0<4.2.16
MongoDB MongoDB>=4.4.0<4.4.11
MongoDB MongoDB>=5.0.0<5.0.4

Never miss a vulnerability like this again

Sign up to SecAlerts for real-time vulnerability data matched to your software, aggregated from hundreds of sources.

Frequently Asked Questions

  • What is CVE-2021-32040?

    CVE-2021-32040 is a vulnerability in MongoDB that allows an attacker to cause a stack overflow and crash the database server in a denial-of-service (DoS) attack.

  • What is the severity of CVE-2021-32040?

    CVE-2021-32040 has a severity score of 7.5, which is considered high.

  • Which versions of MongoDB are affected by CVE-2021-32040?

    Versions 4.2.0 to 4.2.16, 4.4.0 to 4.4.11, and 5.0.0 to 5.0.4 of MongoDB are affected by CVE-2021-32040.

  • How can an attacker exploit CVE-2021-32040?

    An attacker can exploit CVE-2021-32040 by constructing an extremely long aggregation pipeline in MongoDB with a specific stage/operator, causing a stack overflow and crashing the database server.

  • Is there a fix available for CVE-2021-32040?

    Yes, MongoDB has released patches to fix CVE-2021-32040. Users are advised to upgrade to the latest patched version of MongoDB to mitigate the vulnerability.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2024 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203