CVE-2024-5629: PyMongo Out-of-bounds Read in the bson module
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.
Published Jun 5, 2024 · Updated Jun 18, 2024
Affected packages
pymongo
- Ecosystem
- PyPI
- Affected
- < 4.6.3
- Fixed in
- 4.6.3
- Check
pip show pymongo
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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.
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-5629
- https://jira.mongodb.org/browse/PYTHON-4305
- https://github.com/mongodb/mongo-python-driver/commit/56b6b6dbc267d365d97c037082369dabf37405d2
- https://gist.github.com/keltecc/62a7c2bf74a997d0a7b48a0ff3853a03
- https://security.snyk.io/vuln/SNYK-PYTHON-PYMONGO-6370597
- https://lists.debian.org/debian-lts-announce/2024/06/msg00007.html
- https://github.com/advisories/GHSA-m87m-mmvp-v9qm
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-106435
MongoDB Python Driver: Out-of-bounds read in BSON decoding via a malformed Regex element
high8.2Oct 27, 2026CVE-2026-88029
pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods
medium6.1Oct 5, 2026CVE-2026-96747
PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption
medium5.0Oct 5, 2026CVE-2026-96748
PyMongo: PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters
high6.5Oct 5, 2026CVE-2026-96749
PyMongo: PYTHON-5996 Heap out-of-bounds write via signed size overflow in BSON document encoding
high8.4Oct 5, 2026
