CVE-2024-5629: Out-of-bounds read in bson module of PyMongo

Published Jun 5, 2024
·
Updated

An out-of-bounds read in the 'bson' module of PyMongo 4.6.2 or earlier allows deserialization of malformed BSON provided by a Server to raise an exception which may contain arbitrary application memory.

Other sources

Versions of the package pymongo before 4.6.3 are vulnerable to Out-of-bounds Read in the bson module. Using the crafted payload the attacker could force the parser to deserialize unmanaged memory. The parser tries to interpret bytes next to buffer and throws an exception with string. If the following bytes are not printable UTF-8 the parser throws an exception with a single byte.

GitHub

Affected Software

10 affected componentsFixes available
pip/pymongo<4.6.3
4.6.3
debian/pymongo<=3.11.0-1
3.11.0-1+deb12u14.7.3-1
ubuntu/pymongo<3.6.1+dfsg1-1ubuntu0.1~
3.6.1+dfsg1-1ubuntu0.1~
ubuntu/pymongo<3.10.1-0ubuntu2.1
3.10.1-0ubuntu2.1
ubuntu/pymongo<3.11.0-1ubuntu0.22.04.1
3.11.0-1ubuntu0.22.04.1
ubuntu/pymongo<3.11.0-1ubuntu0.24.04.1
3.11.0-1ubuntu0.24.04.1
ubuntu/pymongo<3.2-1ubuntu0.1~
3.2-1ubuntu0.1~
MongoDB pymongo<4.6.3
Debian Debian Linux=10.0
redhat/pymongo<4.6.3
4.6.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pymongo to a version that resolves this vulnerability.

    Fixed in 4.6.3
  2. Upgrade

    Upgrade debian/pymongo to a version that resolves this vulnerability.

    Fixed in 3.11.0-1+deb12u1Fixed in 4.7.3-1
  3. Upgrade

    Upgrade ubuntu/pymongo to a version that resolves this vulnerability.

    Fixed in 3.6.1+dfsg1-1ubuntu0.1~
  4. Upgrade

    Upgrade ubuntu/pymongo to a version that resolves this vulnerability.

    Fixed in 3.10.1-0ubuntu2.1
  5. Upgrade

    Upgrade ubuntu/pymongo to a version that resolves this vulnerability.

    Fixed in 3.11.0-1ubuntu0.22.04.1
  6. Upgrade

    Upgrade ubuntu/pymongo to a version that resolves this vulnerability.

    Fixed in 3.11.0-1ubuntu0.24.04.1
  7. Upgrade

    Upgrade ubuntu/pymongo to a version that resolves this vulnerability.

    Fixed in 3.2-1ubuntu0.1~
  8. Upgrade

    Upgrade redhat/pymongo to a version that resolves this vulnerability.

    Fixed in 4.6.3
  9. Upgrade

    Upgrade pymongo to a version that resolves this vulnerability.

    Fixed in 4.6.3

Event History

Jun 5, 2024
CVE Published
via Ubuntu·12:00 AM
CVE Published
via MITRE·02:32 PM
Data Sourced
via MITRE·02:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Advisory Published
via GitHub·03:30 PM
Jul 22, 2024
Data Sourced
via Launchpad·05:29 PM
Description

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-5629?

CVE-2024-5629 is classified as a high severity vulnerability due to its potential for arbitrary application memory exposure.

2

How do I fix CVE-2024-5629?

To fix CVE-2024-5629, upgrade to PyMongo version 4.6.3 or later.

3

What causes CVE-2024-5629 in PyMongo?

CVE-2024-5629 is caused by an out-of-bounds read in the 'bson' module that allows deserialization of malformed BSON.

4

Which versions of PyMongo are affected by CVE-2024-5629?

Versions of PyMongo prior to 4.6.3 are affected by CVE-2024-5629.

5

Are there alternative ways to mitigate CVE-2024-5629?

Users can limit the exposure of their applications to untrusted BSON data as an alternative mitigation strategy for CVE-2024-5629.

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.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203