Описание
Improper neutralization of special elements in data query logic in the GridFS component of the MongoDB Python Driver can cause a caller-supplied structured file identifier to be interpreted as a query condition rather than as a literal identifier. An authenticated user who can influence the identifier passed by an affected application may obtain stored file content beyond the intended target or cause all GridFS file chunks in the affected bucket to be removed, rendering stored file content unreadable. The affected rename operation may also rename a stored file other than the intended target.
A flaw was found in the GridFS component of the MongoDB Python Driver (pymongo). The driver can treat a caller-supplied structured file identifier as a MongoDB query condition instead of a literal identifier. An authenticated user who can influence the identifier passed to GridFS download, delete, or rename operations may retrieve stored file content beyond the intended target, delete all GridFS chunks in the affected bucket (rendering stored files unreadable), or rename a file other than the intended target.
Отчет
This vulnerability is rated as Important because an authenticated user who can influence a GridFS file identifier can delete all file chunks in the affected bucket, making stored files unreadable, and can retrieve or rename a file other than the intended target. Exploitation requires an application to pass a structured identifier, for example a dictionary containing MongoDB query operators, into GridFS download, delete, or rename APIs rather than a literal identifier such as an ObjectId or string. pymongo is a client library. A deployment is exploitable only if it calls those GridFS APIs with attacker-influenced identifiers. Scalar identifiers are not interpreted as query conditions. Successful exploitation is limited to GridFS-stored file content. It does not by itself provide code execution or host compromise.
Меры по смягчению последствий
There is no complete mitigation for applications that must accept untrusted structured GridFS file identifiers. The following measures reduce risk until a patched pymongo is available:
- Pass only literal identifiers to GridFS download, delete, and rename operations (ObjectId, string, or integer). Do not pass dictionaries, BSON documents, or other structured values derived from user input.
- Restrict which authenticated users can invoke GridFS operations, and do not expose GridFS APIs to untrusted clients.
- If GridFS is not required, avoid using the gridfs module.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-datascience-cpu-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-pytorch-cuda-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-pytorch-llmcompressor-cuda-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-pytorch-rocm-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-tensorflow-cuda-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-tensorflow-rocm-py312-rhel9 | Affected | ||
| Red Hat OpenShift AI (RHOAI) | rhoai/odh-workbench-jupyter-trustyai-cpu-py312-rhel9 | Affected | ||
| Red Hat OpenStack Platform 13 (Queens) | python-pymongo | Will not fix | ||
| Red Hat OpenStack Platform 16.2 | rhosp-rhel8/openstack-horizon | Affected | ||
| Red Hat OpenStack Platform 16.2 | rhosp-rhel8/openstack-zaqar-wsgi | Affected |
Показывать по
Дополнительная информация
Статус:
EPSS
8.3 High
CVSS3
Связанные уязвимости
Improper neutralization of special elements in data query logic in the GridFS component of the MongoDB Python Driver can cause a caller-supplied structured file identifier to be interpreted as a query condition rather than as a literal identifier. An authenticated user who can influence the identifier passed by an affected application may obtain stored file content beyond the intended target or cause all GridFS file chunks in the affected bucket to be removed, rendering stored file content unreadable. The affected rename operation may also rename a stored file other than the intended target.
Improper neutralization of special elements in data query logic in the GridFS component of the MongoDB Python Driver can cause a caller-supplied structured file identifier to be interpreted as a query condition rather than as a literal identifier. An authenticated user who can influence the identifier passed by an affected application may obtain stored file content beyond the intended target or cause all GridFS file chunks in the affected bucket to be removed, rendering stored file content unreadable. The affected rename operation may also rename a stored file other than the intended target.
Improper neutralization of special elements in data query logic in the ...
pymongo: PYTHON-5994 Use exact match for file ID in GridFS delete methods
EPSS
8.3 High
CVSS3