{"cve":"CVE-2026-1839","nvd":{"published":"2026-04-07T06:16:41.490","modified":"2026-10-26T22:10:00.163","status":"Analyzed","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_v4":null,"cvss_v3":{"version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8},"cwes":["CWE-502"],"references":["https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396","https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485","https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485"],"products":["huggingface:transformers"],"source":"nvd","synced_at":"2026-10-26T22:26:44.656832877+00:00"},"epss":{"cve":"CVE-2026-1839","score":0.00382,"percentile":0.3195,"date":"2026-10-26"},"kev":null,"osv":[{"id":"GHSA-69w3-r845-3855","url":"https://osv.dev/vulnerability/GHSA-69w3-r845-3855","summary":"HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class","modified":"2026-09-10T03:50:43.300048881Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<5.0.0rc3"],"fixed":["5.0.0rc3"]}]},{"id":"PYSEC-2026-2288","url":"https://osv.dev/vulnerability/PYSEC-2026-2288","summary":"","modified":"2026-07-13T16:45:06.516869221Z","packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<5.0.0"],"fixed":["5.0.0"]}]}],"attribution":["This product uses the NVD API but is not endorsed or certified by the NVD.","EPSS scores: FIRST Exploit Prediction Scoring System, https://www.first.org/epss","Known exploited vulnerabilities: CISA Known Exploited Vulnerabilities Catalog, https://www.cisa.gov/known-exploited-vulnerabilities-catalog","Package advisories: OSV (https://osv.dev), from the GitHub Advisory Database, PyPA, Go, RustSec and other ecosystem databases, under CC-BY 4.0 or CC0","CVE records: the CVE Program's CVE List (https://www.cve.org), under its terms of use (https://www.cve.org/Legal/TermsOfUse). CVE is a registered trademark of The MITRE Corporation; this product is not affiliated with the CVE Program."]}