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. It arises from the _load_rng_state() method calling torch. load() without the weights_only=True parameter, allowing arbitrary code execution when loading malicious checkpoint files. This affects all versions supporting torch>=2. 2 used with PyTorch versions below 2. 6. The issue is fixed in version v5. 0. 0rc3. The CVSS score is 6.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 04/07/2026, 06:01:27 UTC

Technical Analysis

The vulnerability exists in the HuggingFace Transformers library, specifically in the Trainer class's _load_rng_state() method, which calls torch.load() without the weights_only=True parameter. When used with PyTorch versions below 2.6, the safe_globals() context manager does not provide protection, allowing an attacker to execute arbitrary code by supplying a crafted checkpoint file such as rng_state.pth. This affects all versions supporting torch>=2.2. The issue is resolved in version v5.0.0rc3.

Potential Impact

An attacker who can supply a malicious checkpoint file to the vulnerable Trainer class can achieve arbitrary code execution during the loading process. This can lead to compromise of the host environment where the library is used. The impact includes potential confidentiality loss, integrity compromise, and availability disruption as indicated by the CVSS vector (C:H/I:L/A:H).

Mitigation Recommendations

Upgrade to HuggingFace Transformers version v5.0.0rc3 or later, where this vulnerability is resolved. There is no official patch or temporary fix for earlier versions. Avoid loading untrusted checkpoint files, especially when using PyTorch versions below 2.6. Patch status is not explicitly confirmed beyond the version fix; verify with 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/7/2026, 6:01:27 AM

Last updated: 4/7/2026, 7:29:45 AM

Views: 4

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