Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2026-1839— Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers

Quick assessment

Affected
huggingface huggingface/transformers
Exploitation
No confirmed in-the-wild exploitation; assess based on exposure
Recommended action
Check the vendor advisory and references for a fixed version. If immediate upgrade is impossible, restrict exposure and increase monitoring.

Hugging Face Transformers是Hugging Face开源的一个用于定义最先进机器学习模型的框架,涵盖文本、视觉、音频和多模态模型,可用于推理和训练。 Hugging Face Transformers存在安全漏洞,该漏洞源于Trainer类的_load_rng_state方法调用torch.load时未设置weights_only参数,可能导致攻击者通过恶意检查点文件执行任意代码。

AI Predicted 9.8 Difficulty: Easy EPSS 0.35% · P28
Get alerts for future matching vulnerabilities Log in to subscribe

I. Basic Information for CVE-2026-1839

Vulnerability Information

Have questions about the vulnerability? See if Shenlong's analysis helps!
View Shenlong Deep Dive ↗

Although we use advanced large model technology, its output may still contain inaccurate or outdated information.Shenlong tries to ensure data accuracy, but please verify and judge based on the actual situation.

Vulnerability Title
Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers
Source: CVE Program / CVE List V5
Vulnerability Description
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.
Source: CVE Program / CVE List V5
CVSS Information
N/A
Source: CVE Program / CVE List V5
Vulnerability Type
可信数据的反序列化
Source: CVE Program / CVE List V5
Vulnerability Title
Hugging Face Transformers 安全漏洞
Source: CNNVD (China National Vulnerability Database)
Vulnerability Description
Hugging Face Transformers是Hugging Face开源的一个用于定义最先进机器学习模型的框架,涵盖文本、视觉、音频和多模态模型,可用于推理和训练。 Hugging Face Transformers存在安全漏洞,该漏洞源于Trainer类的_load_rng_state方法调用torch.load时未设置weights_only参数,可能导致攻击者通过恶意检查点文件执行任意代码。
Source: CNNVD (China National Vulnerability Database)
CVSS Information
N/A
Source: CNNVD (China National Vulnerability Database)
Vulnerability Type
N/A
Source: CNNVD (China National Vulnerability Database)

Affected Products

Vendor Product Affected Versions CPE Subscribe
huggingface huggingface/transformers unspecified ~ v5.0.0rc3 -

II. Public POCs for CVE-2026-1839

# POC Description Source Link Shenlong Link
AI-Generated POC Premium

No public POC found.

Login to generate AI POC

III. Intelligence Information for CVE-2026-1839

登录查看更多情报信息。

Vendor Advisories for CVE-2026-1839 (1)

IV. Related Vulnerabilities

V. Comments for CVE-2026-1839

No comments yet


Leave a comment