# CVE-2026-96749: MongoDB Python Driver integer overflow in BSON encoding

Source: https://junglewise.ai/threats/cve-2026-96749-an-integer-overflow-in-the-bson-document-encoding-component-of  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-24. Updated: 2026-09-26  
License: CC BY 4.0 with a link back

CVE-2026-96749 · Severity: high · CVSS 8.4 · Published 2026-09-24

MongoDB's Python driver contains an integer overflow vulnerability in its BSON document encoder that can occur when processing exceptionally large documents. An attacker who can supply large data values to an application could cause the encoder to write outside allocated memory, potentially leading to data corruption, application crashes, or arbitrary code execution within the application process.

Technologies: [MongoDB Python Driver](https://junglewise.ai/threats/technologies/mongodb-python-driver), [pymongo (PyPI)](https://junglewise.ai/threats/technologies/pymongo). Vendors: [MongoDB](https://junglewise.ai/threats/vendors/mongodb), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-96749 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-96749 being exploited in the wild.

**How severe is CVE-2026-96749?** High severity, with a CVSS score of 8.4, published 24 September 2026.

**Which products and versions are affected?** MongoDB Python Driver before 4.18.2; pymongo (PyPI) < 4.18.2, ECOSYSTEM:introduced=0,fixed=4.18.2.

**Is there a fix for CVE-2026-96749?** Yes. pymongo (PyPI): upgrade to 4.18.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-96749 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-96749?** Check whether you run MongoDB Python Driver or pymongo (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pymongo (PyPI): upgrade to 4.18.2 or later

  ```sh
  pip install "pymongo>=4.18.2"
  ```


## Technical details

The vulnerability is a signed 32-bit integer overflow in the BSON document encoding component of the native extension. The overflow guard condition exhibits undefined behavior under the C language standard, allowing a buffer over-write when a single document exceeds certain size thresholds. An unprivileged attacker with the ability to control input data being encoded can trigger this condition; no authentication or special privileges are required.

## Affected products

- MongoDB Python Driver before 4.18.2

## Identifiers

- CVE-2026-96749
- GHSA-v4x9-3549-crwv
- PYSEC-2026-4296

## Timeline

- 2026-09-24: disclosed: CVE-2026-96749 published
- 2026-09-24: patched: Fixed in PyMongo 4.18.2

## References

- [https://github.com/mongodb/mongo-python-driver/blob/4.18.2/doc/changelog.rst](https://github.com/mongodb/mongo-python-driver/blob/4.18.2/doc/changelog.rst)
- [https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.2](https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.2)

## Related threats

- [MongoDB Python Driver out-of-bounds read in BSON decoding](https://junglewise.ai/threats/duplicate-advisory-python-6110-out-of-bounds-read-in-bson-decoding-via-96ff82c3)
- [MongoDB Python Driver buffer over-read in BSON regex parsing](https://junglewise.ai/threats/cve-2026-106435-the-mongodb-python-driver-s-binary-accelerator-can-read-outside)
- [PyMongo connection string parsing host injection](https://junglewise.ai/threats/cve-2026-96748-pymongo-s-connection-string-parsing-decodes-percent-encoded)
- [MongoDB Python Driver Unix socket misinterpretation in key management](https://junglewise.ai/threats/cve-2026-96747-the-client-side-field-level-encryption-support-in-the-mongodb)
- [MongoDB Python Driver improper neutralization in GridFS](https://junglewise.ai/threats/duplicate-advisory-pymongo-python-5994-use-exact-match-for-file-id-in-d4dd5355)
