Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Impact | The CVSS score of 6.5 reflects medium severity with a local attack vector (AV:L), requiring user interaction (UI:R) and high attack complexity (AC:H), but delivering high confidentiality (C:H) and availability (A:H) impact. The exploit requires a local attacker to supply a malicious checkpoint file and requires the target user to load it via the Trainer class, explaining the high complexity and user interaction requirements. EPSS exploitation probability is not provided, but the vulnerability's dependency on specific PyTorch version combinations (torch>=2.2 with PyTorch <2.6) and requirement for local file placement via user action significantly restricts real-world exploitation scope compared to the CVSS score alone. The attack is not confirmed as actively exploited (no KEV status), and no public exploit code is independently confirmed, further reducing immediate priority despite the RCE nature. However, this remains a critical issue for development environments and collaborative ML workflows where checkpoint files are shared, as the attack is straightforward once conditions are met. |
| Exploit ScenarioDerived | A researcher collaborating on a machine learning project shares a checkpoint file containing a malicious |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 07, 2026
Remote code execution in HuggingFace Transformers library allows arbitrary code execution via malicious checkpoint files. The _load_rng_state() method in the Trainer class calls torch.load() without the weights_only=True parameter, enabling deserialization attacks when PyTorch versions below 2.6 are used with torch>=2.2. An attacker can craft a malicious rng_state.pth checkpoint file that executes arbitrary code when loaded by an application using affected Transformers versions. The fix is available in version v5.0.0rc3, and no public exploit has been independently confirmed at time of analysis.
RemediationAI
Upgrade HuggingFace Transformers to version v5.0.0rc3 or later, which addresses the unsafe deserialization by ensuring weights_only=True is specified in torch.load() calls. For users unable to immediately upgrade, restrict access to checkpoint files and validate their origin before loading, particularly in shared environments. Ensure PyTorch is updated to version 2.6 or later if feasible, as this version provides enhanced protection via the safe_globals() context manager. The upstream fix is documented in GitHub commit 03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396 (https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396) and additional details are available from the HuntrAI bounty report (https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485).
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability stems from unsafe deserialization in PyTorch's torch.load() function, which can execute arbitrary Python code embedded in serialized objects (CWE-502: Deserialization of Untrusted Data). The HuggingFace Transformers library's Trainer class uses _load_rng_state() to restore random number generator state from checkpoint files during training resumption. In PyTorch versions below 2.6, the safe_globals() context manager does not restrict code execution during deserialization. When torch>=2.2 is combined with PyTorch <2.6, the library loads checkpoint files without specifying weights_only=True, which would restrict deserialization to tensor data only. The affected CPE (cpe:2.3:a:huggingface:huggingface/transformers:*:*:*:*:*:*:*:*) indicates all versions of the Transformers library are potentially vulnerable when used with the vulnerable PyTorch configuration.
Know when Hugging Face gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Primary rating from NVD.
CVSS VectorNVD
Lifecycle Timeline
4DescriptionNVD
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Hugging Face
View allThe huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data
Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being
Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu
Deserialization of attacker-supplied pickle data in the deprecated pandas packaged builder of Hugging Face Datasets (all
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS
A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,
The huggingface/transformers library, versions prior to 4.53.0, is vulnerable to Regular Expression Denial of Service (R
Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process
Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot
Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte
A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe
EUVD-2026-19573
GHSA-69w3-r845-3855
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB