Is pymongo 4.2 vulnerable?

PyPI · 1 release from 4.2.0 to 4.2.0 · latest pymongo is 4.20.0 · checked 18 Nov 2026

Yes: 6 known advisories

Yes. pymongo 4.2.0, the last 4.2 release, is affected by 6 known security advisories (3 high, 3 medium), including CVE-2026-106435, CVE-2026-96749, CVE-2026-96748. Upgrade to 4.18.3 or later to fix all of them.

Upgrade with:pip install 'pymongo>=4.18.3'

Is your project on an affected pymongo?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Advisories affecting pymongo 4.2.0

  • HighCVE-2026-106435GHSA-98qm-wvgf-w4cf27 Oct 2026

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

    Affected
    >=3.9.0 <4.18.3
    Fixed in
    4.18.3
  • HighCVE-2026-96749GHSA-v4x9-3549-crwv5 Oct 2026

    PyMongo: PYTHON-5996 Heap out-of-bounds write via signed size overflow in BSON document encoding

    Affected
    <4.18.2
    Fixed in
    4.18.2
  • HighCVE-2026-96748GHSA-vp6j-j7w5-5xjj5 Oct 2026

    PyMongo: PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters

    Affected
    >=3.5.0 <4.18.2
    Fixed in
    4.18.2
  • MediumCVE-2026-96747GHSA-qx36-8mw2-4r3x5 Oct 2026

    PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption

    Affected
    >=3.9.0 <4.18.2
    Fixed in
    4.18.2
  • MediumCVE-2026-88029GHSA-8fvv-fgr5-f8ch5 Oct 2026

    pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods

    Affected
    <4.18.1
    Fixed in
    4.18.1
  • MediumCVE-2024-5629GHSA-m87m-mmvp-v9qm5 Jun 2024

    PyMongo Out-of-bounds Read in the bson module

    Affected
    <4.6.3
    Fixed in
    4.6.3

Which of your client projects are still on pymongo 4.2?

NPMscan reads the lockfiles in every GitHub repo you pick, finds the exact pymongo version each one installs, and checks it against these advisories. Each finding comes with the command that fixes it.

Other pymongo versions

Advisory data from OSV.dev (opens OSV.dev in a new tab), which includes the GitHub Advisory Database. Release list from the PyPI registry. Refreshed daily.