CVE-2026-106435: MongoDB Python Driver · Out-of-bounds read in BSON decoding via a malformed Regex element
Affects pymongoSource GCVE Database
Not known to be exploited · CVSS 5.9 Medium : upgrade to 4.18.3 when convenient.
Data as of 27 Oct 2026, 16:29 UTC
- Patch
- Available – fixed in 4.18.3
CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NExploitation evidence
Disclosed: evidence found.
CVE published 8 Oct 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 26 Oct 2026.
What to do
Upgrade pymongo to 4.18.3.
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| PyPIpymongo | Affected
| Fixed in
|
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
A patch is available in PyMongo version 4.18.3 that fixes this vulnerability by raising InvalidBSON exceptions on malformed Regex elements for all buffer types. Users should upgrade to PyMongo 4.18.3 or later. As a workaround, decode untrusted BSON only from NUL-terminated buffers such as bytes or bytearray, or copy mmap input to a NUL-terminated buffer before decoding (e.g., bytes(mm[:size])).
Description
A vulnerability in the MongoDB Python driver (PyMongo) affects the C extension's BSON decoder when processing malformed Regex elements. This flaw allows an out-of-bounds read past the end of the caller's buffer, potentially causing a process crash via an uncatchable SIGSEGV signal. The issue impacts applications decoding untrusted BSON from mmap or array buffers, which lack NUL termination. The vulnerability affects all PyMongo releases from 3.9.0 up to but not including 4.18.3 when the C extension is loaded. The issue is fixed in version 4.18.3, where malformed Regex elements raise an InvalidBSON exception on all buffer types.
References
- github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf (opens in a new tab)
- nvd.nist.gov/vuln/detail/CVE-2026-106435 (opens in a new tab)
- github.com/mongodb/mongo-python-driver/pull/3109 (opens in a new tab)
- github.com/mongodb/mongo-python-driver/commit/bb8d4e195275e75bd94ebeffb53cc747d357fcf4 (opens in a new tab)
- github.com/mongodb/mongo-python-driver (opens in a new tab)
- github.com/mongodb/mongo-python-driver/releases/tag/4.18.3 (opens in a new tab)
- jira.mongodb.org/browse/PYTHON-6110 (opens in a new tab)