Every CVE Search/ Get API key

CVE-2026-106435

Application denial of service via out-of-bounds read in BSON Regex decoding in MongoDB Python Driver

5.9 MediumFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.09%Unchanged since Oct 9, 2026
90%50%10%1%

What each source reports

CVE List Score used 5.9

Application denial of service via out-of-bounds read in BSON Regex decoding in MongoDB Python Driver

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.

Record
CVE-2026-106435
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
5.1 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
EUVDEUVD-2026-95254 5.9

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.

Record
EUVD-2026-95254
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Updated
2026-11-02
GitHub AdvisoriesGHSA-86gh-39m5-hhg6 5.9

Duplicate Advisory: PYTHON-6110 Out-of-bounds read in BSON decoding via a malformed Regex element

Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-98qm-wvgf-w4cf. This link is maintained to preserve external references.

Original Description

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.

Record
GHSA-86gh-39m5-hhg6
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1
5.1 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
GitHub AdvisoriesGHSA-98qm-wvgf-w4cf 8.2

MongoDB Python Driver: Out-of-bounds read in BSON decoding via a malformed Regex element

Impact

The C extension's BSON decoder scans a Regex element's pattern and flags strings with strlen before checking the document's remaining length, so a crafted truncated Regex element can read past the end of the caller's buffer. bson.decode and bson.decode_all accept mmap and array buffers, which carry no NUL sentinel; the read can cross into unmapped memory and kill the process with an uncatchable SIGSEGV. Any application decoding untrusted BSON from such buffers is affected — impact is availability only, since the out-of-bounds bytes are never returned as content. NUL-terminated buffers (bytes, bytearray) raise InvalidBSON at worst; the driver's own transport and pure-Python installs are not affected. All releases through 4.18.2 are affected when the C extension is loaded.

Patches

Fixed in PyMongo 4.18.3. Malformed Regex elements now raise InvalidBSON on every accepted buffer type; valid documents decode unchanged.

Workarounds

Decode untrusted BSON only from NUL-terminated buffers — bytes or bytearray — and copy mmap input first, e.g. bytes(mm[:size]).

Record
GHSA-98qm-wvgf-w4cf
CVSS 4.0
8.2 HighCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-125
Updated
2026-11-02
NVD 5.9

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.

Record
CVE-2026-106435
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1
5.1 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 3.1
4.7 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
OSV 5.9

Application denial of service via out-of-bounds read in BSON Regex decoding in MongoDB Python Driver

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.

Record
CVE-2026-106435
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-125
Updated
2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2026-106435 4.7

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.

Record
DEBIAN-CVE-2026-106435
CVSS 3.1
4.7 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVGHSA-86gh-39m5-hhg6 5.9

Duplicate Advisory: PYTHON-6110 Out-of-bounds read in BSON decoding via a malformed Regex element

Duplicate Advisory

This advisory has been withdrawn because it is a duplicate of GHSA-98qm-wvgf-w4cf. This link is maintained to preserve external references.

Original Description

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.

Record
GHSA-86gh-39m5-hhg6
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
CVSS 3.1
5.1 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-125
Updated
2026-11-02
OSVGHSA-98qm-wvgf-w4cf 8.2

MongoDB Python Driver: Out-of-bounds read in BSON decoding via a malformed Regex element

Impact

The C extension's BSON decoder scans a Regex element's pattern and flags strings with strlen before checking the document's remaining length, so a crafted truncated Regex element can read past the end of the caller's buffer. bson.decode and bson.decode_all accept mmap and array buffers, which carry no NUL sentinel; the read can cross into unmapped memory and kill the process with an uncatchable SIGSEGV. Any application decoding untrusted BSON from such buffers is affected — impact is availability only, since the out-of-bounds bytes are never returned as content. NUL-terminated buffers (bytes, bytearray) raise InvalidBSON at worst; the driver's own transport and pure-Python installs are not affected. All releases through 4.18.2 are affected when the C extension is loaded.

Patches

Fixed in PyMongo 4.18.3. Malformed Regex elements now raise InvalidBSON on every accepted buffer type; valid documents decode unchanged.

Workarounds

Decode untrusted BSON only from NUL-terminated buffers — bytes or bytearray — and copy mmap input first, e.g. bytes(mm[:size]).

Record
GHSA-98qm-wvgf-w4cf
CVSS 4.0
8.2 HighCVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness
CWE-125
Updated
2026-11-02
OSVROOT-APP-PYPI-CVE-2026-106435 4.7

CVE-2026-106435 in pymongo - Patched by Root

Root has patched CVE-2026-106435 in the pymongo package for Root:PyPI. Multiple fixed versions available.

Record
ROOT-APP-PYPI-CVE-2026-106435
CVSS 3.1
4.7 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-05
OSVUBUNTU-CVE-2026-106435 5.9

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.

Record
UBUNTU-CVE-2026-106435
CVSS 4.0
5.9 MediumCVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
CVSS 3.1
4.7 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
CVSS 3.1
5.1 MediumCVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVAZL-107129 No score

CVE-2026-106435 affecting package python-pymongo 4.2.0-9

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.

Record
AZL-107129
Updated
2026-11-05

Affected products

Affected packages

Affected packages
PackageAffectedFixed
pymongo
PyPI
3.9.0 to 4.18.2
4.18.3
python-pymongo
Azure Linux:3
through 4.2.0-9 None known
pymongo
Debian:12
All versions, plus listed versions
3.11.0-13.11.0-1+deb12u14.10.1-14.10.1-24.10.1-3
Show 15 moreShow less
4.10.1-44.10.1-54.10.1-64.15.3-14.15.3-24.15.4-14.15.4-24.15.5-14.16.0-14.17.0-14.18.1-14.18.2-14.19.0-14.7.3-14.7.3-2
None known
pymongo
Debian:13
All versions, plus listed versions
4.10.1-64.15.3-14.15.3-24.15.4-14.15.4-2
Show 6 moreShow less
4.15.5-14.16.0-14.17.0-14.18.1-14.18.2-14.19.0-1
None known
pymongo
Debian:14
before 4.19.0-1, plus listed versions
4.10.1-64.15.3-14.15.3-24.15.4-14.15.4-2
Show 5 moreShow less
4.15.5-14.16.0-14.17.0-14.18.1-14.18.2-1
4.19.0-1
pymongo
PyPI
3.9.0 up to 4.18.3, plus listed versions
3.10.03.10.13.11.03.11.13.11.2
Show 45 moreShow less
3.11.33.11.43.12.03.12.13.12.23.12.33.13.04.04.0.14.0.24.1.04.1.14.10.04.10.14.114.11.14.11.24.11.34.12.04.12.14.13.04.13.0.dev04.13.14.13.24.14.04.14.14.15.04.15.14.15.24.15.34.15.44.15.54.16.04.16.0.dev04.17.04.18.04.18.14.18.24.2.04.3.24.3.34.4.04.4.0b04.4.14.5.0
4.18.3
pymongo
Root:PyPI
before 4.18.2+aikido.1
4.18.2+aikido.14.9.2+aikido.3
pymongo
Ubuntu:14.04:LTS
All versions, plus listed versions
2.6-12.6.2-12.6.3-12.6.3-1build1
None known
pymongo
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
3.0.3-13.2-13.2-1build13.2-1ubuntu0.1~esm1
None known
pymongo
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
3.4.0-1build23.6.1+dfsg1-13.6.1+dfsg1-1ubuntu0.1~esm1
None known
Show 5 moreShow less
Affected packages
PackageAffectedFixed
pymongo
Ubuntu:20.04:LTS
All versions, plus listed versions
3.7.1-1.13.7.1-1.1build13.10.1-0ubuntu23.10.1-0ubuntu2.1
None known
pymongo
Ubuntu:22.04:LTS
All versions, plus listed versions
3.11.0-1build23.11.0-1build33.11.0-1build43.11.0-1ubuntu0.22.04.1
None known
pymongo
Ubuntu:24.04:LTS
All versions, plus listed versions
3.11.0-1build63.11.0-1build73.11.0-1build83.11.0-1ubuntu0.24.04.1
None known
pymongo
Ubuntu:26.10
All versions, plus listed versions
4.16.0-1build14.17.0-1
None known
pymongo
Ubuntu:26.04:LTS
All versions, plus listed versions
4.10.1-64.15.3-14.15.3-24.15.5-14.16.0-14.16.0-1build1
None known

History

History
RecordedChangedSources
affected, factsOSV
affected
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-106435 is a medium vulnerability (CVSS 5.9) in Mongodb Python Driver, published October 8, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.09%, the 0th percentile. Fixed in pymongo 4.18.3.

References

Show 7 moreShow less
This page doesn't list everything

Left out here: 13 versions. The JSON record has them.

MoveEnter Open