{"id":"CVE-2026-106435","aliases":["GHSA-98qm-wvgf-w4cf"],"url":"https://o3.security/vulnerability/CVE-2026-106435","summary":"Application denial of service via out-of-bounds read in BSON Regex decoding in MongoDB Python Driver","details":"### Impact\nThe 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.\n\n### Patches\nFixed in PyMongo 4.18.3. Malformed Regex elements now raise InvalidBSON on every accepted buffer type; valid documents decode unchanged.\n\n###  Workarounds\nDecode untrusted BSON only from NUL-terminated buffers — bytes or bytearray — and copy mmap input first, e.g. bytes(mm[:size]).","published":"2026-10-08T20:12:15.074Z","modified":"2026-10-28T02:30:38.734544464Z","cvss":null,"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"PyPI","name":"pymongo","fixedVersion":"4.18.3"}],"fix":{"url":"https://github.com/mongodb/mongo-python-driver/pull/3109","label":"mongodb/mongo-python-driver#3109"},"references":[{"type":"WEB","url":"https://jira.mongodb.org/browse/PYTHON-6110"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/106xxx/CVE-2026-106435.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106435"},{"type":"WEB","url":"https://github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf"},{"type":"WEB","url":"https://github.com/mongodb/mongo-python-driver/pull/3109"},{"type":"WEB","url":"https://github.com/mongodb/mongo-python-driver/commit/bb8d4e195275e75bd94ebeffb53cc747d357fcf4"},{"type":"PACKAGE","url":"https://github.com/mongodb/mongo-python-driver"},{"type":"WEB","url":"https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.3"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-10-28T02:30:38.734544464Z"}}