PT-2026-30793 · Pytorch+1 · Pytorch+1

Anton Vlasjuk

+2

·

Published

2026-04-07

·

Updated

2026-04-19

·

CVE-2026-1839

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

Weakness Enumeration

Related Identifiers

CVE-2026-1839
GHSA-69W3-R845-3855

Affected Products

Huggingface/Transformers
Pytorch