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

exploitDog

github логотип

GHSA-69w3-r845-3855

Опубликовано: 07 апр. 2026
Источник: github
Github: Прошло ревью
CVSS3: 6.5

Описание

HuggingFace Transformers allows for arbitrary code execution in the Trainer class

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.

Пакеты

Наименование

transformers

pip
Затронутые версииВерсия исправления

< 5.0.0rc3

5.0.0rc3

EPSS

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

6.5 Medium

CVSS3

Дефекты

CWE-502

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

CVSS3: 6.7
redhat
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: 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.

EPSS

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

6.5 Medium

CVSS3

Дефекты

CWE-502