PYTHON-5996 Heap out-of-bounds write via signed size overflow in BSON document encoding
High7.5CVE-2026-96749 · Published Sep 24, 2026
An integer overflow in the BSON document encoding component of the MongoDB Python Driver's bundled native extension may occur when a single document is built from an unusually large amount of caller-supplied data. Size arithmetic is performed in a signed 32-bit type, and the guard meant to catch the overflow is written in a form whose behavior is not defined by the C language standard. A party with no privileges who can place a very large value into data that an application encodes may, depending on how the native extension was built, cause a write outside the bounds of an allocated buffer inside the application's own process.
Affected versions
| Package | Affected | Fixed in |
|---|---|---|
| pymongo PyPI | < 4.18.2 | 4.18.2 |
Details and references
- CVSS 4.0
- CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
- Severity from
- GitHub (reviewed advisory)
- Weakness
- CWE-190
More MongoDB advisories
All MongoDB| Date | Advisory | Severity | Fixed in |
|---|---|---|---|
| Sep 24 | PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters | High8.3 | 4.18.2 |
| Sep 24 | MongoDB: improper input validation | Medium5.3 | 4.18.2 |
| Sep 24 | Improper neutralization of special elements in data query logic in the cache... | High7.1 | 5.11.0 |
| Sep 24 | MongoDB Compass: code injection | High7.3 | 1.49.12 |
| Sep 24 | Heap buffer overflow via mid-scan command list growth in client topology monitoring | High8.3 | 1.30.12+1 more |
| Sep 24 | PHP object injection via unsuppressible __pclass class inference in command monitoring events | Medium6.3 | 1.21.10+2 more |