CVE-2026-1839: huggingface/transformers · Deserialization of Untrusted Data
Affects huggingface/transformersSource CVE Database V5
Not known to be exploited · CVSS 6.5 Medium · fixed in 5.0.0 : update huggingface/transformers when convenient.
Data as of 29 Oct 2026, 19:04 UTC
- EPSS
- 0.3% chance of exploitation in 30 days – higher than 32% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
- Patch
- Available – fixed in 5.0.0
CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:HExploitation evidence
Disclosed: evidence found.
CVE published 7 Apr 2026
Detectable: no evidence on record.
No public nuclei template indexed
Weaponized: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 29 Oct 2026.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
| huggingfacehuggingface/transformers | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
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.
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.