CVE-2026-106435
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.
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
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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 High
CVSS: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 Medium
CVSS: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 Medium
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 3.1
- 4.7 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 High
CVSS: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 Medium
CVSS: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 Medium
CVSS: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 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H - CVSS 3.1
- 5.1 Medium
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
pymongoPyPI |
3.9.0 to 4.18.2 | 4.18.3 |
python-pymongoAzure Linux:3 |
through 4.2.0-9 | None known |
pymongoDebian: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 less4.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 |
pymongoDebian: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 less4.15.5-14.16.0-14.17.0-14.18.1-14.18.2-14.19.0-1 |
None known |
pymongoDebian: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 less4.15.5-14.16.0-14.17.0-14.18.1-14.18.2-1 |
4.19.0-1 |
pymongoPyPI |
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 less3.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 |
pymongoRoot:PyPI |
before 4.18.2+aikido.1 | 4.18.2+aikido.14.9.2+aikido.3 |
pymongoUbuntu:14.04:LTS |
All versions, plus listed versions 2.6-12.6.2-12.6.3-12.6.3-1build1 |
None known |
pymongoUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 3.0.3-13.2-13.2-1build13.2-1ubuntu0.1~esm1 |
None known |
pymongoUbuntu: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
| Package | Affected | Fixed |
|---|---|---|
pymongoUbuntu: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 |
pymongoUbuntu: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 |
pymongoUbuntu: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 |
pymongoUbuntu:26.10 |
All versions, plus listed versions 4.16.0-1build14.17.0-1 |
None known |
pymongoUbuntu: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
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | OSV | |
| affected | ||
| first indexed | CVE 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
jira.mongodb.org/browse/PYTHON-6110
nvd.nist.gov/vuln/detail/CVE-2026-106435
github.com/advisories/GHSA-86gh-39m5-hhg6
github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf
github.com/mongodb/mongo-python-driver/pull/3109
github.com/mongodb/mongo-python-driver/commit/bb8d4e195275e75bd94ebeffb53cc747d357fcf4
Show 7 moreShow less
github.com/mongodb/mongo-python-driver/releases/tag/4.18.3
github.com/advisories/GHSA-98qm-wvgf-w4cf
github.com/CVEProject/cvelistV5/tree/main/cves/2026/106xxx/CVE-2026-106435.json
security-tracker.debian.org/tracker/CVE-2026-106435
github.com/mongodb/mongo-python-driver
ubuntu.com/security/CVE-2026-106435
cve.org/CVERecord?id=CVE-2026-106435
Left out here: 13 versions. The JSON record has them.