Summary
The native C BSON decoding extension of the MongoDB Python Driver (PyMongo) contains an out-of-bounds read (CWE-125) when decoding BSON arrays. Versions from 1.9.0 up to, but not including, 4.20.2 are affected.
Per the CVSS vector (score 8.2, high), the attack is network-based, low complexity, and requires no authentication or user interaction. The attacker only needs to be able to supply crafted BSON data to the decoder.
The result is termination of the application process (denial of service, high availability impact). In some configurations, nearby process memory may be included in error messages, leading to limited unintended data disclosure. It is not listed in the CISA KEV catalog.
Who is affected
Organizations developing or running Python applications that use the MongoDB Python Driver (versions 1.9.0 – < 4.20.2) with the C extension, especially those processing BSON data from untrusted sources.
What to do
- Upgrade the MongoDB Python Driver (pymongo) to version 4.20.2 or later.
- Inventory all applications, virtual environments and container images and check the installed version (e.g. pip show pymongo).
- Determine whether applications decode BSON data from untrusted sources and restrict such input until upgraded.
- Ensure error messages are not returned to users or logged where unauthorized parties can access them.
- Follow the vendor advisory (https://jira.mongodb.org/browse/PYTHON-6256) for further details.
Affected products and versions
CVSS vector, explained
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:H
- Attack vector
- Network (from the internet)
- Attack complexity
- Low
- Privileges required
- None (no login)
- User interaction
- Not required
- Scope
- Vulnerable component only
- Confidentiality
- Low impact
- Integrity
- None
- Availability
- High impact
Weakness type (CWE)
- CWE-125 Out-of-bounds Read
References
Sources: CVE.org (CNA and CISA ADP), CISA KEV, FIRST EPSS. Always check the vendor's official advisory.