CVE-2026-96749: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-96749 is a heap out-of-bounds write vulnerability caused by a signed integer overflow in the BSON document encoding component of the MongoDB Python Driver (PyMongo). It affects all versions from 1.9.0 up to (but not including) 4.18.2, and was published on September 24, 2026. The flaw resides in the bundled native C extension; applications that do not use the C extension are not affected in the same way. It carries a CVSS v3.1 base score of 8.4 (High) and a CVSS v4.0 base score of 7.5 (High) (Github Advisory, MongoDB Advisory).

Technical details

The root cause is an integer overflow or wraparound (CWE-190 / CAPEC-92) in the C extension's BSON document size arithmetic, which uses a signed 32-bit integer type. When a single BSON document is assembled from an unusually large amount of caller-supplied data, the size calculation can overflow, and the overflow guard is written in a form whose behavior is undefined by the C language standard — meaning a compiler may legally optimize it away. The result is a heap out-of-bounds write within the application's own process memory. Exploitation requires that an attacker be able to supply a very large value into data that the application subsequently encodes as BSON; no privileges are required, but the attack vector is local (the attacker must be able to influence the data passed to the encoder) and attack requirements are present (the application must use the native C extension) (Github Advisory, MongoDB Advisory).

Impact

Successful exploitation can cause a write outside the bounds of an allocated heap buffer inside the application's process, with high impact to confidentiality, integrity, and availability. Depending on heap layout and how the native extension was compiled, this could enable arbitrary code execution within the application process, potentially allowing an attacker to read sensitive in-memory data, corrupt application state, or crash the process entirely. The scope is limited to the vulnerable system itself; subsequent systems are not directly impacted according to the CVSS v4.0 assessment (Github Advisory, MongoDB Advisory).

Exploitability

As of the time of publication, there is no public proof-of-concept exploit and no evidence of in-the-wild exploitation (Github Advisory). The EPSS score is approximately 0.132% (2nd percentile), indicating a low near-term probability of exploitation. The NVD SSVC assessment classifies exploitation as "none" and the vulnerability as not automatable. No threat actor attribution has been reported, and the CVE is not listed in the CISA Known Exploited Vulnerabilities catalog.

Exploitation steps

  1. Identify target: Locate an application that uses PyMongo with the native C extension enabled (versions 1.9.0–4.18.2) and accepts externally supplied data that is subsequently encoded as a BSON document.
  2. Craft oversized input: Prepare a very large value (e.g., a string or binary blob approaching or exceeding 2 GB) intended to be inserted as a field value in a BSON document, so that the total document size calculation overflows a signed 32-bit integer.
  3. Inject the data: Supply the oversized value through any application input path that feeds into a PyMongo insert, update, or similar BSON-encoding operation — for example, via a web form, API endpoint, or message queue that the application processes and stores in MongoDB.
  4. Trigger the overflow: When the application calls the C extension's BSON encoder with the crafted document, the signed 32-bit size arithmetic overflows and the undefined-behavior overflow guard fails to catch it, causing the encoder to write beyond the allocated heap buffer.
  5. Achieve code execution or crash: Depending on heap layout and compiler optimizations, the out-of-bounds write may corrupt adjacent heap metadata or function pointers, potentially enabling arbitrary code execution within the application process, or causing a crash (denial of service) (Github Advisory, MongoDB Advisory).

Indicators of compromise

  • Process: Unexpected crashes or segmentation faults in Python processes using PyMongo, particularly during document insert or update operations involving large data payloads.
  • Logs: Application error logs showing memory corruption errors, heap corruption messages, or abnormal termination signals (SIGSEGV, SIGABRT) from the PyMongo C extension.
  • File System: Core dump files generated by the Python process in the working directory or system core dump location following an unexpected crash.
  • Application Behavior: Anomalous behavior following processing of unusually large BSON documents, such as data corruption in MongoDB collections or unexpected application state changes.

Mitigation and workarounds

The primary remediation is to upgrade PyMongo to version 4.18.2 or later, which hardens the BSON buffer size guard against signed integer overflow (PyMongo Release, Changelog). If immediate patching is not possible, restrict access to application functions that encode BSON documents with untrusted or externally supplied data, and implement input validation to enforce maximum document/field sizes before they reach the BSON encoder. Applications that do not use the bundled native C extension (i.e., running pure-Python BSON encoding) are not vulnerable to this specific heap write issue, though upgrading remains strongly recommended.

Community reactions

The vulnerability was covered by security news outlets including SecurityOnline and Linux security roundup publications, and was picked up by distribution security teams including SUSE (SUSE-SU-2026:4398-1) and openSUSE, which issued their own advisories and package updates (SUSE Advisory). Red Hat also tracked the CVE. The MongoDB community forum published a release announcement for PyMongo 4.18.2 noting the security fixes. No significant controversy or notable researcher commentary beyond standard disclosure has been observed.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

pymongo

Affected

sid

pymongo: 4.18.2-1

Fixed

trixie

pymongo

Affected

Ubuntu

Affected

bionic (esm-infra)

pymongo

Unknown

devel

pymongo

Unknown

focal (esm-infra)

pymongo

Unknown

jammy

pymongo

Affected

noble

pymongo

Affected

resolute

pymongo

Affected

trusty (esm-infra-legacy)

pymongo

Unknown

xenial (esm-infra-legacy)

pymongo

Unknown

RHEL / CentOS

Affected

RHEL 8

python36:3.6/python-pymongo.src

Affected

Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-rh2h-69fp-q55vHIGH7
  • Python logoPython
  • virtualenv
NoYesNov 21, 2026
GHSA-vmhf-2rcw-c624MEDIUM4.5
  • Python logoPython
  • virtualenv
NoYesNov 21, 2026
GHSA-7c26-x6xg-6f39LOW3.6
  • Python logoPython
  • virtualenv
NoNoNov 21, 2026
GHSA-vg73-7844-8q8gLOW3.3
  • Python logoPython
  • virtualenv
NoYesNov 21, 2026
GHSA-rq56-gqmj-pggpLOW3.3
  • Python logoPython
  • virtualenv
NoYesNov 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management