Skip to main content

Hugging Face CVE-2026-1839

| EUVDEUVD-2026-19573 HIGH
Deserialization of Untrusted Data (CWE-502)
2026-04-07 @huntr_ai GHSA-69w3-r845-3855
7.8
CVSS 3.1 · NVD
Share

Severity by source

NVD PRIMARY
7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Red Hat
6.7 MEDIUM
qualitative

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

7
Re-analysis Queued
Apr 28, 2026 - 16:52 vuln.today
cvss_changed
Severity Changed
Apr 28, 2026 - 16:52 NVD
MEDIUM HIGH
CVSS changed
Apr 28, 2026 - 16:52 NVD
6.5 (MEDIUM) 7.8 (HIGH)
Patch released
Apr 08, 2026 - 02:30 nvd
Patch available
EUVD ID Assigned
Apr 07, 2026 - 05:30 euvd
EUVD-2026-19573
Analysis Generated
Apr 07, 2026 - 05:30 vuln.today
CVE Published
Apr 07, 2026 - 05:22 nvd
MEDIUM 6.5

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 30 pypi packages depend on transformers (22 direct, 8 indirect)

Ecosystem-wide dependent count for version 5.0.0rc3.

DescriptionCVE.org

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.

AnalysisAI

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.

Technical ContextAI

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.

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).

CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

CVE-2026-33625 HIGH POC
8.8 Sep 18

Arbitrary Python code execution in LMDeploy 0.12.1 through 0.12.2 lets an attacker who publishes a malicious model on Hu

CVE-2023-6730 HIGH POC
8.8 Dec 19

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2023-7018 HIGH POC
7.8 Dec 20

Deserialization of Untrusted Data in GitHub repository huggingface/transformers prior to 4.36. Rated high severity (CVSS

CVE-2025-3262 HIGH POC
7.5 Jul 07

A Regular Expression Denial of Service (ReDoS) vulnerability was discovered in the huggingface/transformers repository,

CVE-2026-66007 MEDIUM POC
6.9 Jul 24

Path traversal in Hugging Face Datasets up to 5.0.0 allows attackers to read arbitrary local files when a victim process

CVE-2026-69112 MEDIUM POC
6.9 Aug 10

Path traversal in Hugging Face Accelerate through 1.14.0 exposes two distinct attack outcomes when a user loads a crafte

CVE-2026-63086 MEDIUM POC
6.9 Jul 16

Server-side request forgery in HuggingFace text-generation-inference through version 3.3.7 enables unauthenticated remot

CVE-2025-1194 MEDIUM POC
6.5 Apr 29

A Regular Expression Denial of Service (ReDoS) vulnerability was identified in the huggingface/transformers library, spe

CVE-2026-5241 CRITICAL
9.6 Jun 03

Remote code execution in Hugging Face Transformers 5.2.0 allows a malicious model repository to bypass the user's explic

CVE-2025-11844 MEDIUM POC
5.4 Oct 22

XPath injection in Hugging Face Smolagents 1.20.0 lets an attacker who can influence the text passed to the vision web b

CVE-2026-25874 CRITICAL
9.3 Apr 23

Unauthenticated remote code execution in HuggingFace LeRobot (versions 0 through 0.5.1) stems from pickle.loads() being

Vendor StatusVendor

Share

CVE-2026-1839 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy