{"id":"CVE-2026-1839","published":"2026-04-07T05:22:00Z","modified":"2026-04-07T13:27:41Z","title":"Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers","vendor":"huggingface","product":"huggingface/transformers","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":6.5,"severity":"MEDIUM","version":"3.0","vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00388,"percentile":0.33759,"provenance":"source"},"cwes":[{"id":"CWE-502","name":"Deserialization of Untrusted Data"}],"references":[{"url":"https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485","tags":[]},{"url":"https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396","tags":[]}],"priority":{"score":11.3,"factors":[{"name":"EPSS percentile","points":6.75},{"name":"CVSS severity","points":4.55}]},"vendorSlug":"huggingface","affectedVersions":[{"vendor":"huggingface","product":"huggingface/transformers","versions":[">= unspecified, < v5.0.0rc3"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total","timestamp":"2026-04-07T13:27:38.099805Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"transformers","vulnerableRanges":["<5.0.0rc3","<5.0.0"],"patched":["5.0.0rc3","5.0.0"],"from":["GHSA-69w3-r845-3855","PYSEC-2026-2288"],"provenance":"source"}],"summary":{"text":"The flaw is an unsafe call to torch.load() without weights_only=True in the _load_rng_state() method of the Trainer class in the HuggingFace Transformers library (src/transformers/trainer.py), which is a deserialization of untrusted data issue. An attacker who supplies a malicious checkpoint file such as rng_state.pth can achieve arbitrary code execution when it is loaded, which requires local access, a victim to be induced into interacting with the file, and a PyTorch version below 2.6 (with torch>=2.2 in use).","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:57:41Z"},"euvd":{"id":"EUVD-2026-19573","exploited":false,"provenance":"source"},"lineage":{"packageHistory":[{"cve":"CVE-2025-6051","published":"2025-09-14","fixed":"4.53.0","kev":false},{"cve":"CVE-2025-6638","published":"2025-09-12","fixed":"4.53.0","kev":false},{"cve":"CVE-2025-6921","published":"2025-09-23","fixed":"4.53.0","kev":false},{"cve":"CVE-2026-1839","published":"2026-04-07","fixed":"5.0.0","kev":false},{"cve":"CVE-2026-4372","published":"2026-05-24","fixed":"5.3.0","kev":false,"link":{"from":"CVE-2026-1839","to":"CVE-2026-4372","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:transformers","fromFixed":"5.0.0","toFixed":"5.3.0","daysApart":47}]}},{"cve":"CVE-2026-5241","published":"2026-06-03","fixed":"5.5.0","kev":false},{"cve":"CVE-2026-9856","published":"2026-08-02","fixed":"5.10.0","kev":false}],"package":"PyPI:transformers"}}