Live › vulnerability › CVE-2026-106435
Go to dashboardPyMongo's C BSON decoder reads past the end of the caller's buffer when a Regex element is truncated, because it scans for a NUL terminator before checking the remaining length. An attacker who can supply untrusted BSON decoded from mmap or array buffers can crash the process with SIGSEGV, a denial of service; the out-of-bounds bytes are not returned.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-27 15:39 UTC, 0h before NVD. All times on this page are UTC.
Applications that decode untrusted BSON with the C extension loaded, particularly through bson.decode or bson.decode_all on mmap or array buffers, are exposed. Applications that only decode NUL-terminated bytes or bytearray buffers raise InvalidBSON instead, and the driver's own transport and pure-Python installs are not affected.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| pymongo | pypi | >= 3.9.0, <= 4.18.2 | 4.18.3 |
| mongodb python driver | vendor | < 4.18.3 | 4.18.3 |
pip show pymongo and confirm the installed version is 4.18.2 or lower, which is affected when the C extension is loaded.bson.decode or bson.decode_all calls that take mmap or array input from untrusted sources.4.18.3 or later.bytes or bytearray, and copy mmap input first, e.g. bytes(mm[:size]).Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
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.
Fixed in PyMongo 4.18.3. Malformed Regex elements now raise InvalidBSON on every accepted buffer type; valid documents decode unchanged.
Decode untrusted BSON only from NUL-terminated buffers — bytes or bytearray — and copy mmap input first, e.g. bytes(mm[:size]).
This page as .md · .json · in your agent: get_signal("CVE-2026-106435")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.