{"id":"CVE-2026-106435","aliases":["CVE-2026-106435","GHSA-98qm-wvgf-w4cf"],"related":[],"kind":"vulnerability","state":"published","title":"Application denial of service via out-of-bounds read in BSON Regex decoding in MongoDB Python Driver","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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]).","format":"markdown","source":"ghsa"}],"published":"2026-10-08T20:12:15.074Z","modified":"2026-10-27T15:47:24.276Z","severity":{"scorer":"mongodb","scheme":"CVSS:4.0","vector":"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","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"mongodb","scheme":"CVSS:4.0","vector":"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","score":5.9,"rating":"MEDIUM"},{"scorer":"mongodb","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"semver","introduced":"0.10.3","lastAffected":"4.18.2","status":"affected"}],"vendor":"MongoDB","product":"Python Driver","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.9.0","status":"affected","fixed":"4.18.3"}],"ecosystem":"PyPI","package":"pymongo","purl":"pkg:pypi/pymongo","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"4.18.3"}],"vendor":"mongodb","product":"python_driver","cpe":"cpe:2.3:a:mongodb:python_driver:*:*:*:*:*:mongodb:*:*","source":"nvd"}],"references":[{"url":"https://jira.mongodb.org/browse/PYTHON-6110","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106435","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/mongodb/mongo-python-driver/pull/3109","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mongodb/mongo-python-driver/commit/bb8d4e195275e75bd94ebeffb53cc747d357fcf4","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/mongodb/mongo-python-driver","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.3","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mongodb","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-09T11:49:15.521Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-106435","url":"https://www.cve.org/CVERecord?id=CVE-2026-106435","licence":"CVE Terms of Use","modified":"2026-10-09T11:49:28.787Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-98qm-wvgf-w4cf","url":"https://github.com/advisories/GHSA-98qm-wvgf-w4cf","licence":"CC-BY-4.0","modified":"2026-10-27T15:47:24.276Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-106435","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-106435","licence":"Public domain","modified":"2026-10-15T17:00:36.980Z"}],"updatedAt":"2026-11-25T22:59:43.227Z","epss":{"score":0.00094,"percentile":0.00603,"date":"2026-12-01T12:00:22.000Z"}}