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

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, pymongo (PyPI). Vendors: MongoDB, 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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.