CVE-2026-96749 — pymongo
Fix: mongodb/mongo-python-driver#3066CVE-2026-96749 is a CWE-190 vulnerability in pymongo. A fix is available for pymongo — see the affected versions and patch details below.
Heap out-of-bounds write via signed size overflow in BSON document encoding
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-96749.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
pymongoReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | pymongo | all versions | 4.18.2pip install --upgrade 'pymongo==4.18.2' |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pymongo, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update pymongo to 4.18.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-96749 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This vulnerability is rated as Moderate severity by Red Hat Product Security because exploitation requires an application to accept and serialize massive quantities of untrusted input into a single document, which typically triggers application crashes or memory exhaustion rather than arbitrary code execution. PyMongo…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenShift AI 2.25 | rhoai/odh-pipeline-runtime-pytorch-llmcompressor-cuda-py312-rhel9:1791867208 | RHSA-2026:87410 |
| Red Hat OpenShift AI 3.5 | rhoai/odh-pipeline-runtime-datascience-cpu-py312-rhel9:1791952873 | RHSA-2026:86891 |
Frequently Asked Questions
Is CVE-2026-96749 in your dependencies?
Find it across PyPI, including transitive dependencies.