Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

redhat логотип

CVE-2026-1839

Опубликовано: 07 апр. 2026
Источник: redhat
CVSS3: 6.7
EPSS Низкий

Описание

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 Coreopenshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9Fix deferred
Lightspeed Coreredhat-user-workloads/lightspeed-stackFix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-ocp-rag-rhel9Fix deferred
OpenShift Lightspeedopenshift-lightspeed/lightspeed-service-api-rhel9Fix deferred
OpenShift Lightspeedredhat-user-workloads/lightspeed-rag-toolFix deferred
Red Hat AI Inference Serverredhat-user-workloads/rhaiis-cpu-ubi9-3-3Fix deferred
Red Hat AI Inference Serverredhat-user-workloads/rhaiis-cuda-ubi9-3-2-2Fix deferred
Red Hat AI Inference Serverredhat-user-workloads/rhaiis-cuda-ubi9-3-3Fix deferred
Red Hat AI Inference Serverredhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-2-2Fix deferred
Red Hat AI Inference Serverredhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-3Fix deferred

Показывать по

Дополнительная информация

Статус:

Moderate
Дефект:
CWE-502
https://bugzilla.redhat.com/show_bug.cgi?id=2455854transformers: HuggingFace Transformers: Arbitrary code execution via malicious checkpoint file

EPSS

Процентиль: 28%
0.00349
Низкий

6.7 Medium

CVSS3

Связанные уязвимости

CVSS3: 7.8
nvd
4 месяца назад

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.

CVSS3: 6.5
github
4 месяца назад

HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class

EPSS

Процентиль: 28%
0.00349
Низкий

6.7 Medium

CVSS3