PT-2026-30793 · Hugging Face+1 · Huggingface/Transformers+1

·

CVE-2026-1839

·

Published

2026-04-07

·

Updated

2026-04-19

CVSS v3.1

7.8

High

VectorAV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Name of the Vulnerable Software and Affected Versions HuggingFace Transformers versions prior to 5.0.0rc3
Description A flaw exists in the Trainer class within the HuggingFace Transformers library. The load rng state() method, located in src/transformers/trainer.py at line 3059, utilizes torch.load() without the weights only=True parameter. This creates a risk of arbitrary code execution when using PyTorch versions below 2.6 and Transformers versions supporting torch>=2.2. An attacker can exploit this by providing a malicious checkpoint file, such as rng state.pth, which can execute arbitrary code upon loading.
Recommendations Update to version 5.0.0rc3 or later.

Exploit

Fix

Deserialization of Untrusted Data

Found an issue in the description? Have something to add? Feel free to write us 👾

Weakness Enumeration

Related Identifiers

CVE-2026-1839
ECHO-9BD3-047A-4B4A
GHSA-69W3-R845-3855
PYSEC-2026-2288

Affected Products

Huggingface/Transformers
Pytorch