Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

pymongo

Latest version: v4.20.2

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
PyPI package Publisher: 10gen
4,363 Stars
1,168 Forks
4 Versions
76.3M Downloads
Python Repo language

Scan summary

pymongo was last scanned on 25 Nov 2026 at version 4.20.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions; the latest 2 were published within 7 days (19–25 Nov 2026).
  • Findings: No rules fired in version 4.20.2.
  • Downloads: 76,328,025 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
4.20.2 LATEST 25 Nov 2026 No rules fired
4.20.1 19 Nov 2026 No rules fired
4.20.0 12 Nov 2026 No rules fired
4.19.0 14 Oct 2026 Not shown

No rules fired in 4.20.2

Findings

Findings for v4.20.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 4.20.2; other versions have their own rules, not their own score.

Known vulnerabilities

7 CVEs · last 8 Oct 2026

0 CRITICAL 3 HIGH 4 MEDIUM 0 LOW

Versions

  • ≥ 4.18.3
  • ≥ 4.18.2, < 4.18.3 1 MEDIUM
  • ≥ 4.18.1, < 4.18.2 2 HIGH 2 MEDIUM
  • ≥ 4.6.3, < 4.18.1 2 HIGH 3 MEDIUM
  • ≥ 3.9.0, < 4.6.3 3 HIGH 3 MEDIUM
  • ≥ 3.5.0, < 3.9.0 3 HIGH 1 MEDIUM
  • ≥ 2.5.2, < 3.5.0 2 HIGH 1 MEDIUM
  • < 2.5.2 2 HIGH 2 MEDIUM

Vulnerabilities

  • CVE-2026-106435 Medium 8 Oct 2026 pymongo: pymongo: Denial of Service via out-of-bounds read during malformed BSON decoding Fixed in 4.18.3
  • CVE-2026-96749 High 24 Sep 2026 pymongo: pymongo: Out-of-bounds write via integer overflow during BSON encoding Fixed in 4.18.2
  • CVE-2026-96748 High 24 Sep 2026 pymongo: pymongo: Database connection redirection via percent-encoded host delimiter injection Fixed in 4.18.2
  • CVE-2026-96747 Medium 24 Sep 2026 pymongo: pymongo: Forced local socket connection via manipulated key management endpoint Fixed in 4.18.2
  • CVE-2026-88029 Medium 10 Sep 2026 pymongo: MongoDB Python Driver: Data disclosure and denial of service via query-operator injection Fixed in 4.18.1
  • CVE-2024-5629 High 5 Jun 2024 python-pymongo: Out-of-bounds read in bson module Fixed in 4.6.3
  • CVE-2013-2132 Medium 15 Aug 2013 pymongo: null pointer when decoding invalid DBRef Fixed in 2.5.2

Seal Security (PyPI)

Seal Security ships a patched build of this package. Its fixed versions:

  • CVE-2026-106435: 4.17.0+sp999, 4.18.1+sp999
  • CVE-2026-88029: 3.8.0+sp999
  • CVE-2026-96748: 3.8.0+sp999
  • CVE-2026-96749: 3.8.0+sp999

README

The publisher’s own README, as collected from the registry.

PyMongo

PyPI Version Python Versions

About

The PyMongo distribution contains tools for interacting with MongoDB database from Python. The bson package is an implementation of the BSON format for Python. The pymongo package is a native Python driver for MongoDB, offering both synchronous and asynchronous APIs. The gridfs package is a gridfs implementation on top of pymongo.

PyMongo supports MongoDB 4.4, 5.0, 6.0, 7.0, 8.0, and 9.0. PyMongo follows semantic versioning for its releases.

Documentation

Documentation is available at mongodb.com.

API documentation and the full changelog for each release is available at readthedocs.io.

Support / Feedback

For issues with, questions about, or feedback for PyMongo, please look into our support channels. Please do not email any of the PyMongo developers directly with issues or questions - you're more likely to get an answer on StackOverflow (using a "mongodb" tag).

Bugs / Feature Requests

Think you've found a bug? Want to see a new feature in PyMongo? Please open a case in our issue management tool, JIRA:

Bug reports in JIRA for all driver projects (i.e. PYTHON, CSHARP, JAVA) and the Core Server (i.e. SERVER) project are public.

How To Ask For Help

Please include all of the following information when opening an issue:

  • Detailed steps to reproduce the problem, including full traceback, if possible.

  • The exact python version used, with patch level:

python -c "import sys; print(sys.version)"
  • The exact version of PyMongo used, with patch level:
python -c "import pymongo; print(pymongo.version); print(pymongo.has_c())"
  • The operating system and version (e.g. Windows 7, OSX 10.8, ...)

  • Web framework or asynchronous network library used, if any, with version (e.g. Django 1.7, mod_wsgi 4.3.0, gevent 1.0.1, Tornado 4.0.2, ...)

Security Vulnerabilities

If you've identified a security vulnerability in a driver or any other MongoDB project, please report it according to the instructions here.

Installation

PyMongo can be installed with pip:

python -m pip install pymongo

You can also download the project source and do:

pip install .

Do not install the "bson" package from pypi. PyMongo comes with its own bson package; running "pip install bson" installs a third-party package that is incompatible with PyMongo.

Dependencies

PyMongo supports CPython 3.11+.

Required dependencies:

Support for mongodb+srv:// URIs requires dnspython

Optional dependencies:

GSSAPI authentication requires pykerberos on Unix or WinKerberos on Windows. The correct dependency can be installed automatically along with PyMongo:

python -m pip install "pymongo[gssapi]"

MONGODB-AWS authentication requires pymongo-auth-aws:

python -m pip install "pymongo[aws]"

OCSP (Online Certificate Status Protocol) requires PyOpenSSL, requests, service_identity and may require certifi:

python -m pip install "pymongo[ocsp]"

Wire protocol compression with snappy requires python-snappy:

python -m pip install "pymongo[snappy]"

Wire protocol compression with zstandard requires backports.zstd when used with Python versions before 3.14:

python -m pip install "pymongo[zstd]"

Client-Side Field Level Encryption requires pymongocrypt and pymongo-auth-aws:

python -m pip install "pymongo[encryption]"

You can install all dependencies automatically with the following command:

python -m pip install "pymongo[gssapi,aws,ocsp,snappy,zstd,encryption]"

Examples

Here's a basic example (for more see the examples section of the docs):

>>> import pymongo
>>> client = pymongo.MongoClient("localhost", 27017)
>>> db = client.test
>>> db.name
'test'
>>> db.my_collection
Collection(Database(MongoClient('localhost', 27017), 'test'), 'my_collection')
>>> db.my_collection.insert_one({"x": 10}).inserted_id
ObjectId('4aba15ebe23f6b53b0000000')
>>> db.my_collection.insert_one({"x": 8}).inserted_id
ObjectId('4aba160ee23f6b543e000000')
>>> db.my_collection.insert_one({"x": 11}).inserted_id
ObjectId('4aba160ee23f6b543e000002')
>>> db.my_collection.find_one()
{'x': 10, '_id': ObjectId('4aba15ebe23f6b53b0000000')}
>>> for item in db.my_collection.find():
...     print(item["x"])
10
8
11
>>> db.my_collection.create_index("x")
'x_1'
>>> for item in db.my_collection.find().sort("x", pymongo.ASCENDING):
...     print(item["x"])
8
10
11
>>> [item["x"] for item in db.my_collection.find().limit(2).skip(1)]
[8, 11]

Learning Resources

Testing

The easiest way to run the tests is to run the following from the repository root.

pip install -e ".[test]"
pytest

For more advanced testing scenarios, see the contributing guide.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases pymongo

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Frame 2085668439 (1)
Group 1261154229