Описание
A vulnerability in the HuggingFace Transformers library, specifically in the Trainer class, allows for arbitrary code execution. The _load_rng_state() method in src/transformers/trainer.py at line 3059 calls torch.load() without the weights_only=True parameter. This issue affects all versions of the library supporting torch>=2.2 when used with PyTorch versions below 2.6, as the safe_globals() context manager provides no protection in these versions. An attacker can exploit this vulnerability by supplying a malicious checkpoint file, such as rng_state.pth, which can execute arbitrary code when loaded. The issue is resolved in version v5.0.0rc3.
A flaw was found in HuggingFace Transformers. A remote attacker can exploit this vulnerability by supplying a specially crafted checkpoint file (e.g., rng_state.pth). The _load_rng_state() method in the Trainer class loads this file using torch.load() without proper validation, specifically missing the weights_only=True parameter. This issue primarily affects systems using PyTorch versions below 2.6. Successful exploitation can lead to arbitrary code execution on the system where the file is loaded.
Меры по смягчению последствий
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.
Затронутые пакеты
| Платформа | Пакет | Состояние | Рекомендация | Релиз |
|---|---|---|---|---|
| Lightspeed Core | openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9 | Fix deferred | ||
| Lightspeed Core | redhat-user-workloads/lightspeed-stack | Fix deferred | ||
| OpenShift Lightspeed | openshift-lightspeed/lightspeed-ocp-rag-rhel9 | Fix deferred | ||
| OpenShift Lightspeed | openshift-lightspeed/lightspeed-service-api-rhel9 | Fix deferred | ||
| OpenShift Lightspeed | redhat-user-workloads/lightspeed-rag-tool | Fix deferred | ||
| Red Hat AI Inference Server | redhat-user-workloads/rhaiis-cpu-ubi9-3-3 | Fix deferred | ||
| Red Hat AI Inference Server | redhat-user-workloads/rhaiis-cuda-ubi9-3-2-2 | Fix deferred | ||
| Red Hat AI Inference Server | redhat-user-workloads/rhaiis-cuda-ubi9-3-3 | Fix deferred | ||
| Red Hat AI Inference Server | redhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-2-2 | Fix deferred | ||
| Red Hat AI Inference Server | redhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-3 | Fix deferred |
Показывать по
Дополнительная информация
Статус:
EPSS
6.7 Medium
CVSS3
Связанные уязвимости
A vulnerability in the HuggingFace Transformers library, specifically in the `Trainer` class, allows for arbitrary code execution. The `_load_rng_state()` method in `src/transformers/trainer.py` at line 3059 calls `torch.load()` without the `weights_only=True` parameter. This issue affects all versions of the library supporting `torch>=2.2` when used with PyTorch versions below 2.6, as the `safe_globals()` context manager provides no protection in these versions. An attacker can exploit this vulnerability by supplying a malicious checkpoint file, such as `rng_state.pth`, which can execute arbitrary code when loaded. The issue is resolved in version v5.0.0rc3.
HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class
EPSS
6.7 Medium
CVSS3