Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-1839: CWE-502 Deserialization of Untrusted Data in huggingface huggingface/transformers

0
Medium
VulnerabilityCVE-2026-1839cvecve-2026-1839cwe-502
Published: Tue Apr 07 2026 (04/07/2026, 05:22:00 UTC)
Source: CVE Database V5
Vendor/Project: huggingface
Product: huggingface/transformers

Description

CVE-2026-1839 is a deserialization vulnerability in the HuggingFace Transformers library's Trainer class that allows arbitrary code execution when loading malicious checkpoint files. The issue arises because the _load_rng_state() method calls torch. load() without the weights_only=True parameter, and the safe_globals() context manager does not provide protection in PyTorch versions below 2. 6. This affects all versions of the library supporting torch>=2. 2 used with PyTorch versions below 2. 6. The vulnerability is resolved in version v5. 0. 0rc3.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/14/2026, 16:13:03 UTC

Technical Analysis

The vulnerability in huggingface/transformers (CVE-2026-1839) involves unsafe deserialization in the Trainer class's _load_rng_state() method, which uses torch.load() without the weights_only=True parameter. When used with PyTorch versions below 2.6, the safe_globals() context manager does not mitigate the risk, allowing an attacker to execute arbitrary code by providing a crafted checkpoint file (e.g., rng_state.pth). This affects all library versions supporting torch>=2.2 with PyTorch < 2.6. The issue is fixed in version v5.0.0rc3.

Potential Impact

An attacker who can supply a malicious checkpoint file to the Trainer class can execute arbitrary code on the system loading the checkpoint. This can lead to confidentiality, integrity, and availability impacts, including code execution and potential system compromise. The vulnerability requires local access to supply the malicious file and user interaction to load it, as indicated by the CVSS vector (AV:L/UI:R).

Mitigation Recommendations

The vulnerability is resolved in huggingface/transformers version v5.0.0rc3. Users should upgrade to this version or later to mitigate the issue. If upgrading is not immediately possible, avoid loading untrusted checkpoint files with affected versions and PyTorch versions below 2.6. Patch status is not explicitly stated beyond the fix in v5.0.0rc3; check the vendor advisory for the latest remediation guidance.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
@huntr_ai
Date Reserved
2026-02-03T16:49:27.781Z
Cvss Version
3.0
State
PUBLISHED
Remediation Level
null

Threat ID: 69d49a21aaed68159acbc2ad

Added to database: 4/7/2026, 5:46:09 AM

Last enriched: 4/14/2026, 4:13:03 PM

Last updated: 5/22/2026, 9:59:51 AM

Views: 195

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses