CVE-2026-1839Huggingface Transformers Deserialization of Untrusted Data
NVDCVSS scored by NVD (NIST)
Vulnerability Summary
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 v3.1 Base Metrics — Score 7.8 (HIGH)
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HAttack VectorLocal
Attack ComplexityLow
Privileges RequiredNone
User InteractionRequired
ScopeUnchanged
ConfidentialityHigh
IntegrityHigh
AvailabilityHigh
Affected & Patched Versions
- Huggingface Transformers < 5.0.0
- Huggingface Transformers
- huggingface/transformers >= unspecified and < v5.0.0rc3
- Huggingface Transformers 5.0.0
- huggingface/transformers v5.0.0rc3
What to do
Prioritize this fix. Exploit code is public, so attacks can follow quickly.
- Check whether you run Huggingface Transformers and which version.
- Update to a patched version listed above, then confirm the new version.
- Review logs and exposed services for signs of earlier compromise.
Timeline
- Apr 7, 2026Published
- Oct 26, 2026Record last modified
Score, severity and exploitation changes are tracked from the day Watchtower started logging them.
Get notified about new Huggingface Transformers CVEsYou are reading CVE-2026-1839. Get an email when KEV listings, exploits or new CVEs match your stack.
Set up CVE alertsMore Huggingface Transformers CVEs
External References
Data last checked: Nov 22, 2026 17:11 UTC