Skip to content
HighVulnerability

CVE-2026-1839: HuggingFace Transformers Trainer arbitrary code execution via torch.load

Identifier
CVE-2026-1839
Published
Record updated
View JSON
Affected
  • transformers < 5.0.0rc3
Fixed in
5.0.0rc3
  • released January 14, 2026, 83 days before disclosure
Known exploitation
Not listed in the CISA Known Exploited Vulnerabilities catalog at the last check.
EPSS
0.4%

Summary

CVE-2026-1839 affects the HuggingFace Transformers library, specifically the `Trainer` class. The `_load_rng_state()` method in `src/transformers/trainer.py` at line 3059 calls `torch.load()` without `weights_only=True`, and the issue affects all versions supporting `torch>=2.2` used with PyTorch versions below 2.6. An attacker who supplies a malicious checkpoint file such as `rng_state.pth` can execute arbitrary code when it is loaded.

Mitigation

The issue is resolved in version v5.0.0rc3.