Vulnerabilities in pkg:pypi/pymongo
PACKAGECVE-2026-96749 is a HIGH (CVSS 8.4) python-5996 heap out-of-bounds write vulnerability (CWE-190: Integer Overflow or Wraparound) affecting PyMongo libraries in the PyPI ecosystem. The issue involves python-5996 heap out-of-bounds write via signed size overflow in bson document encoding. Remediation is available by upgrading affected packages to version 4.18.2.
pkg:pypi/pymongo
Vulnerability advisories affecting package pkg:pypi/pymongo. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-v4x9-3549-crwv | CVE-2026-96749 | HIGH | PyMongo: PYTHON-5996 Heap out-of-bounds write via signed size overflow in BSON document encoding |
| GHSA-vp6j-j7w5-5xjj | CVE-2026-96748 | HIGH | PyMongo: PYTHON-5986 Host injection in PyMongo connection string parsing via percent-encoded delimiters |
| GHSA-qx36-8mw2-4r3x | CVE-2026-96747 | MODERATE | PyMongo: PYTHON-5990 Forced Unix domain socket connection via a .sock KMS endpoint in client-side field level encryption |
| GHSA-8fvv-fgr5-f8ch | CVE-2026-88029 | MODERATE | pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods |
| GHSA-8h2c-ghff-mpg9 | - | MODERATE | Duplicate Advisory: pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods |
| GHSA-x33v-f3gp-gw2c | CVE-2013-2132 | MODERATE | Use of NullPointerException Catch to Detect NULL Pointer Dereference in Pymongo |
| GHSA-m87m-mmvp-v9qm | CVE-2024-5629 | MODERATE | PyMongo Out-of-bounds Read in the bson module |
| GHSA-cr6f-gf5w-vhrc | - | MODERATE | PyMongo Out-of-bounds Read in the bson module |
CVE-2026-96749 at a Glance
Security Impact
CVSS: 8.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-96749
To remediate this vulnerability, upgrade all affected PyMongo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pymongo>=4.18.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pymongo
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-96749, inspect your installed packages using pip:
pip show pymongo
Analyze the terminal output to locate any version of PyMongo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.18.2), your application is affected.
Note: The pip show pymongo command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In PyMongo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-96749 Affected PyMongo Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pymongo
|
PyPI |
< 4.18.2
|
4.18.2
|
References
Frequently Asked Questions
What is CVE-2026-96749?
Which PyMongo versions are affected?
What version fixes CVE-2026-96749?
Is pymongo affected?
What is the CVSS score of CVE-2026-96749?
What CWE is associated with CVE-2026-96749?
How can I check PyPI dependencies for CVE-2026-96749?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v4x9-3549-crwv",
"modified" : "2026-10-05T23:47:11Z",
"published" : "2026-10-05T23:47:10Z",
"aliases" : [ "CVE-2026-96749" ],
"summary" : "PyMongo: PYTHON-5996 Heap out-of-bounds write via signed size overflow in BSON document encoding",
"details" : "An integer overflow in the BSON document encoding component of the MongoDB Python Driver's bundled native extension may occur when a single document is built from an unusually large amount of caller-supplied data. Size arithmetic is performed in a signed 32-bit type, and the guard meant to catch the overflow is written in a form whose behavior is not defined by the C language standard. A party with no privileges who can place a very large value into data that an application encodes may, depending on how the native extension was built, cause a write outside the bounds of an allocated buffer inside the application's own process.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pymongo"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "4.18.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/security/advisories/GHSA-v4x9-3549-crwv"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-96749"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/pull/3066"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/commit/640dd2383a1a2fb1a10e5222d50ebc0b22a61bd7"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/commit/6ab44be0e97c9d1d5a23725c4978fb25f3249485"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/mongodb/mongo-python-driver"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/blob/4.18.2/doc/changelog.rst"
}, {
"type" : "WEB",
"url" : "https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.2"
}, {
"type" : "WEB",
"url" : "https://www.mongodb.com/community/forums/t/pymongo-4-18-2-released/343732"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-190" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-10-05T23:47:10Z",
"nvd_published_at" : "2026-09-24T19:17:20Z"
}
}