PyMongo Out-of-bounds Read in the bson moduleGHSA-m87m-mmvp-v9qm
MEDIUMFix: mongodb/mongo-python-driver@56b6b6dGHSA-m87m-mmvp-v9qm is a medium-severity (CVSS 4.7) Out-of-bounds Read vulnerability in pymongo. A fix is available for pymongo — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-m87m-mmvp-v9qm.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
pymongoReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
Versions of the package pymongo before 4.6.3 are vulnerable to Out-of-bounds Read in the bson module. Using the crafted payload the attacker could force the parser to deserialize unmanaged memory. The parser tries to interpret bytes next to buffer and throws an exception with string. If the following bytes are not printable UTF-8 the parser throws an exception with a single byte.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | pymongo | all versions | 4.6.3pip install --upgrade 'pymongo==4.6.3' |
Affected Products
debian linuxdebianpymongomongodbDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pymongo, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update pymongo to 4.6.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-m87m-mmvp-v9qm is resolved across your whole dependency graph.
Workarounds
Stop feeding it untrusted input: reject or quarantine files and payloads from unverified sources until you can upgrade, restrict accepted formats to the ones you actually need, and run the parsing or decoding step in a least-privileged sandbox or short-lived worker so a crash or corrupted read cannot reach the rest of the process.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Only RHEL-8 is impacted by this vulnerability as `python-pymongo` is not packaged in RHEL-7 or RHEL-9.
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.Source: Red Hat security advisory for GHSA-m87m-mmvp-v9qm (CC BY 4.0)
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat Enterprise Linux 8 | python36:3.6-8100020250430074622.4c5117ad | RHSA-2025:8419 |
Frequently Asked Questions
Is GHSA-m87m-mmvp-v9qm in your dependencies?
Find it across PyPI, including transitive dependencies.