Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. pymongo
  4. ›
  5. CVE-2026-106435

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

October 27, 2026

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.

References

  • github.com/advisories/GHSA-98qm-wvgf-w4cf
  • github.com/mongodb/mongo-python-driver/commit/bb8d4e195275e75bd94ebeffb53cc747d357fcf4
  • github.com/mongodb/mongo-python-driver/pull/3109
  • github.com/mongodb/mongo-python-driver/releases/tag/4.18.3
  • github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf
  • jira.mongodb.org/browse/PYTHON-6110
  • nvd.nist.gov/vuln/detail/CVE-2026-106435

Code Behaviors & Features

Detect and mitigate CVE-2026-106435 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions starting from 3.9.0 before 4.18.3

Fixed versions

  • 4.18.3

Solution

Upgrade to version 4.18.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-125: Out-of-bounds Read

Source file

pypi/pymongo/CVE-2026-106435.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:49 +0000.