CVE-2026-106435
Medium · 5.1CVSS
5.1
EPSS
0.1%
Published
Oct 8, 2026
CISA due date
—
Cloudanix analysis
A flaw in the MongoDB Python driver can let specially crafted data crash an application that uses it, but only when an optional speed-up component is turned on and only through certain decoding functions.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Buffer Overflow
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Out-of-bounds read in the C-accelerated BSON decoder when processing a truncated regular-expression element lacking a trailing NUL byte, resulting in process termination via the documented decode/decode_all APIs.
Why it matters to the business
Applications using the Python driver with the C extension enabled can be crashed by untrusted BSON input, causing denial of service; the issue does not affect normal database communication paths.
How an attack unfolds
An attacker crafts BSON containing a malformed regex element without a trailing NUL, supplies it to an application that calls the driver's decode or decode_all functions, and triggers the out-of-bounds read that terminates the process when the C extension is active.
How to fix it
Disable the C extension by setting the environment variable PYMONGO_C_EXT=0 or installing without the C extension until a patched driver version is released; monitor the MongoDB Python driver release notes for the security update.
How to confirm the fix worked
Confirm the C extension is loaded with import pymongo; print(pymongo.has_c()); attempt to decode a test BSON payload containing a truncated regex element and verify the process no longer crashes after mitigation.
Typical attack path
- Identify an application endpoint or API that accepts and decodes BSON via PyMongo's decode or decode_all
- Craft a truncated BSON regex element lacking the required NUL terminator
- Submit the malformed BSON to the vulnerable decode path while the C accelerator is loaded
- Observe process crash and denial of service
How to detect it
Review application and system logs for unexpected Python process terminations or segmentation faults occurring shortly after BSON decode calls; correlate with any custom code paths that invoke decode or decode_all on untrusted input.
What your security team should do
- Immediately evaluate whether the C extension is required and disable it where possible
- Inventory all applications using the MongoDB Python driver and prioritize upgrades once a fixed release is published
- Add runtime checks or input sanitization around any custom BSON decoding paths
- Monitor upstream driver releases and apply patches within standard change windows
The record
The MongoDB Python Driver's binary accelerator can read outside a buffer when an application decodes malformed BSON containing a truncated regular-expression element without a trailing NUL byte. An actor who can supply BSON to the documented decode or decode_all API can cause the application process to terminate when the C extension is loaded. The driver's normal database wire-protocol path does not reach this code.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-62958 libriscv is a RISC-V sandbox and emulator. CWE-125
- CVE-2026-119338 Tesseract is an open source OCR engine. CWE-125
- CVE-2026-119299 gopacket provides packet processing capabilities for Go. CWE-125
- CVE-2026-119722 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap out-of-bounds access… CWE-125
- CVE-2026-119721 Blender before 4.5.15 and 5.x before 5.2.3 contains an out-of-bounds read vulnerability… CWE-125
- CVE-2026-119720 Blender before 4.5.15 and 5.x before 5.2.3 contains a heap out-of-bounds read… CWE-125
- CVE-2026-104063 Scribus before 1.6.7 contains an out-of-bounds read vulnerability in the Mac PICT image… CWE-125
- CVE-2026-61627 libass is a portable subtitle renderer for the `ASS`/SSA (Advanced Substation… CWE-125