BREW-MONGO-ORCHESTRATION… (GHSA-98QM-WVGF-W4CF)

Vulnerability from osv_homebrew – Published: 2026-10-29 23:26 – Updated: 2026-10-29 23:26 – Source website
VLAI
Summary
MongoDB Python Driver: Out-of-bounds read in BSON decoding via a malformed Regex element
Details

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]).


{
  "affected": [
    {
      "ecosystem_specific": {
        "fix": "bump",
        "range_state": "fixed",
        "resource": "pymongo",
        "resource_purl": "pkg:pypi/pymongo@4.19.0",
        "upstream_fixed_in": "4.18.3"
      },
      "package": {
        "ecosystem": "Homebrew",
        "name": "mongo-orchestration",
        "purl": "pkg:brew/mongo-orchestration"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.7.0"
            },
            {
              "fixed": "0.11.2_5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "confidence": "high",
    "source": "matched",
    "strategy": "registry",
    "upstream_evidence": [
      {
        "ecosystem": "PyPI",
        "key": "pkg:pypi/pymongo@4.19.0",
        "name": "pymongo",
        "resource": "pymongo",
        "strategy": "registry",
        "subject_version": "4.19.0"
      }
    ]
  },
  "details": "### Impact\nThe C extension\u0027s BSON decoder scans a Regex element\u0027s pattern and flags strings with strlen before checking the document\u0027s remaining length, so a crafted truncated Regex element can read past the end of the caller\u0027s 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 \u2014 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\u0027s 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 \u2014 bytes or bytearray \u2014 and copy mmap input first, e.g. bytes(mm[:size]).",
  "id": "BREW-mongo-orchestration-CVE-2026-106435",
  "modified": "2026-10-29T23:26:10Z",
  "published": "2026-10-29T23:26:10Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/mongodb/mongo-python-driver/security/advisories/GHSA-98qm-wvgf-w4cf"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-106435"
    },
    {
      "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"
    },
    {
      "type": "WEB",
      "url": "https://jira.mongodb.org/browse/PYTHON-6110"
    }
  ],
  "schema_version": "1.7.3",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "MongoDB Python Driver: Out-of-bounds read in BSON decoding via a malformed Regex element",
  "upstream": [
    "GHSA-98qm-wvgf-w4cf",
    "CVE-2026-106435"
  ]
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.