MEDIUM6.1
PYSEC-2026-4294
pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods
Quick fix
PYSEC-2026-4294 — pymongo: upgrade to the fixed version with the command below.
pip install --upgrade 'pymongo>=4.18.1'Details
### Impact
When reading/writing via an ID with the GridFS API, require an exact match on the given ID. Otherwise, if a Hash is given in place of the ID, it may be interpreted as criteria, overriding the ID match.
### Patches Patch available in pymongo >= 4.18.1
### Workarounds Ensure your existing workflow _only_ supports exact matching on the GridFS API.
Are you affected?
Enter the version of the package you're using.
Affected packages
References
- https://github.com/mongodb/mongo-python-driver/security/advisories/GHSA-8fvv-fgr5-f8ch[WEB]
- https://nvd.nist.gov/vuln/detail/CVE-2026-88029[ADVISORY]
- https://github.com/mongodb/mongo-python-driver/pull/3046[WEB]
- https://github.com/mongodb/mongo-python-driver/commit/3ef1c607859589a0086446ad6f557791a2813681[WEB]
- https://github.com/mongodb/mongo-python-driver/commit/fa676586ba4b399168a4d1d41c30dc2166cc44fd[WEB]
- https://github.com/mongodb/mongo-python-driver[PACKAGE]
- https://github.com/mongodb/mongo-python-driver/releases/tag/4.18.1[WEB]
- https://jira.mongodb.org/browse/PYTHON-5992[WEB]
- https://pypi.org/project/pymongo[PACKAGE]
- https://github.com/advisories/GHSA-8fvv-fgr5-f8ch[ADVISORY]
Check it before you install it
One call answers whether to add this package: known advisories, CISA KEV, and whether the name is a hallucinated or freshly squatted one. No key needed to try it.
curl -s https://vdb.ai.kr/v1/ai/check-packages \
-H 'Content-Type: application/json' \
-d '{"packages":["pkg:pypi/pymongo"]}'