# MongoDB Python Driver out-of-bounds read in BSON decoding

Source: https://junglewise.ai/threats/duplicate-advisory-python-6110-out-of-bounds-read-in-bson-decoding-via-96ff82c3  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-08. Updated: 2026-10-27  
License: CC BY 4.0 with a link back

Severity: medium · CVSS 5.1 · Published 2026-10-08

The MongoDB Python Driver's binary accelerator contains a flaw that reads beyond allocated memory when processing malformed BSON data with truncated regular-expression elements. An attacker who can supply specially crafted BSON to an application's decode or decode_all API can crash the application process, causing a denial of service.

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 This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Medium severity, with a CVSS score of 5.1, published 8 October 2026.

**Which products and versions are affected?** MongoDB Python Driver 3.9.0 through 4.18.2; pymongo (PyPI) >= 3.9.0, <= 4.18.2, ECOSYSTEM:introduced=3.9.0,last_affected=4.18.2.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked with local access, in a software library.

**Am I affected?** 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.

## Technical details

An out-of-bounds read vulnerability exists in the C extension binary accelerator when decoding BSON containing a truncated regular-expression element lacking a trailing NUL byte. The vulnerable code path is only reachable via the documented decode or decode_all API; the driver's normal database wire-protocol path does not trigger this issue. Exploitation requires the attacker to supply malformed BSON directly to the application.

## Affected products

- MongoDB Python Driver 3.9.0 through 4.18.2

## Timeline

- 2026-10-08: disclosed
- 2026-10-08: advisory: GHSA-86gh-39m5-hhg6 published
- 2026-10-27: other: Advisory withdrawn as duplicate of GHSA-98qm-wvgf-w4cf

## Related threats

- [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)
- [MongoDB Python Driver integer overflow in BSON encoding](https://junglewise.ai/threats/cve-2026-96749-an-integer-overflow-in-the-bson-document-encoding-component-of)
- [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)
