7.8

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

Analyzed
AliasesGHSA-69w3-r845-3855PYSEC-2026-2288CGA-2mrv-mrmw-8qhw
Published 07-04-2026Last modified 07-04-2026

Vulnerability summary

CVE-2026-1839 is a high (CVSS 7.8) Deserialization of Untrusted Data vulnerability in huggingface huggingface/transformers. EPSS estimates a 0.38% chance of exploitation in the next 30 days, higher than 32.2% of scored vulnerabilities. 1 public exploit is recorded.

Priority
Routine

Not severe (CVSS 6.5, local access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
7.8/10
010
High · v3.1 (NVD)
EPSS score
0.38%
0%100%
Low · 0.00 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits1reference

Advisory lineage

Upstream 0 · Downstream 0 · Related 1

Timeline

  1. 07-04-2026
    PublishedVulnerability first disclosed.
  2. 07-04-2026
    Last modifiedVulnerability information updated.

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.

CVSS metrics

5 scores · 4 sources · 2 versions

EPSS trend

Probability

0.38%

Chance of exploitation in the next 30 days

Percentile

32%

Versus all other CVEs

30-day change

No change 0.00 pp

From 0.38% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • referenceUnverified

    Exploit Reference (huntr.com)

    Maturity: unknown

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: local access, no authentication, user interaction (CVSS vector). Other conditions: not stated in public data.

Chainguard14 products
  • lmcache-cuda-12.8< 0.4.4-r0
  • nemo< 2.7.3-r1
  • py3.10-transformers-4.51All versions (No fix recorded)
  • py3.10-transformers-4.56< 4.56.2-r2
  • py3.11-transformers-4.51All versions (No fix recorded)
Huggingface2 products
PyPI1 product
  • transformers< 5.0.0rc3 | < 5.0.0

3 vendors · 17 products

References

7 links