Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-1839
Published:April 07, 2026
Updated:April 26, 2026
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.
Affected Packages
https://github.com/huggingface/transformers.git (GITHUB):
Affected version(s) >=v0.1.2 <v5.0.0rc3
Fix Suggestion:
Update to version v5.0.0rc3
transformers (PYTHON):
Affected version(s) >=0.1 <5.0.0rc3
Fix Suggestion:
Update to version 5.0.0rc3
transformers (PYTHON):
Affected version(s) >=0.1 <5.0.0rc3
Fix Suggestion:
Update to version 5.0.0rc3
Do you need more information?
Contact Us
CVSS v4
Base Score:
5.8
Attack Vector
LOCAL
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
LOW
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
6.5
Attack Vector
LOCAL
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
REQUIRED
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
LOW
Availability
HIGH
Weakness Type (CWE)
Deserialization of Untrusted Data
EPSS
Base Score:
0.02