{"id":"CVE-2026-1839","aliases":["CLSA-2026-1779065183","EUVD-2026-19573","GHSA-69w3-r845-3855","PYSEC-2026-2288"],"status":"published","title":"Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers","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\u003e=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.","severity":{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00388,"percentile":0.33334,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-502"],"published":"2026-04-07T05:22:00Z","modified":"2026-10-28T02:30:42Z","fixes":[{"ecosystem":"PyPI","package":"transformers","fixed_in":["5.0.0rc3","5.0.0"],"sources":["ghsa","osv"]},{"ecosystem":"TuxCare:PyPI","package":"transformers","fixed_in":["4.57.6.post1+tuxcare"],"sources":["osv"]}],"affected":[{"source":"ghsa","ecosystem":"PyPI","package":"transformers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.0rc3"}]}]},{"source":"osv","ecosystem":"TuxCare:PyPI","package":"transformers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.57.6"},{"fixed":"4.57.6.post1+tuxcare"}]}],"versions":["4.57.6"]},{"source":"osv","ecosystem":"PyPI","package":"transformers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.0rc3"}]}],"versions":["0.1","2.0.0","2.1.0","2.1.1","2.10.0","2.11.0","2.2.0","2.2.1","2.2.2","2.3.0","2.4.0","2.4.1","2.5.0","2.5.1","2.6.0","2.7.0","2.8.0","2.9.0","2.9.1","3.0.0","3.0.1","3.0.2","3.1.0","3.2.0","3.3.0","3.3.1","3.4.0","3.5.0","3.5.1","4.0.0","4.0.0rc1","4.0.1","4.1.0","4.1.1","4.10.0","4.10.1","4.10.2","4.10.3","4.11.0","4.11.1","4.11.2","4.11.3","4.12.0","4.12.1","4.12.2","4.12.3","4.12.4","4.12.5","4.13.0","4.14.0","4.14.1","4.15.0","4.16.0","4.16.1","4.16.2","4.17.0","4.18.0","4.19.0","4.19.1","4.19.2","4.19.3","4.19.4","4.2.0","4.2.1","4.2.2","4.20.0","4.20.1","4.21.0","4.21.1","4.21.2","4.21.3","4.22.0","4.22.1","4.22.2","4.23.0","4.23.1","4.24.0","4.25.0","4.25.1","4.26.0","4.26.1","4.27.0","4.27.1","4.27.2","4.27.3","4.27.4","4.28.0","4.28.1","4.29.0","4.29.1","4.29.2","4.3.0","4.3.0rc1","4.3.1","4.3.2","4.3.3","4.30.0","4.30.1","4.30.2","4.31.0","4.32.0","4.32.1","4.33.0","4.33.1","4.33.2","4.33.3","4.34.0","4.34.1","4.35.0","4.35.1","4.35.2","4.36.0","4.36.1","4.36.2","4.37.0","4.37.1","4.37.2","4.38.0","4.38.1","4.38.2","4.39.0","4.39.1","4.39.2","4.39.3","4.4.0","4.4.1","4.4.2","4.40.0","4.40.1","4.40.2","4.41.0","4.41.1","4.41.2","4.42.0","4.42.1","4.42.2","4.42.3","4.42.4","4.43.0","4.43.1","4.43.2","4.43.3","4.43.4","4.44.0","4.44.1","4.44.2","4.45.0","4.45.1","4.45.2","4.46.0","4.46.1","4.46.2","4.46.3","4.47.0","4.47.1","4.48.0","4.48.1","4.48.2","4.48.3","4.49.0","4.5.0","4.5.1","4.50.0","4.50.1","4.50.2","4.50.3","4.51.0","4.51.1","4.51.2","4.51.3","4.52.0","4.52.1","4.52.2","4.52.3","4.52.4","4.53.0","4.53.1","4.53.2","4.53.3","4.54.0","4.54.1","4.55.0","4.55.1","4.55.2","4.55.3","4.55.4","4.56.0","4.56.1","4.56.2","4.57.0","4.57.1","4.57.2","4.57.3","4.57.4","4.57.5","4.57.6","4.6.0","4.6.1","4.7.0","4.8.0","4.8.1","4.8.2","4.9.0","4.9.1","4.9.2","5.0.0rc0","5.0.0rc1","5.0.0rc2"]},{"source":"osv","ecosystem":"PyPI","package":"transformers","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"5.0.0"}]}],"versions":["0.1","2.0.0","2.1.0","2.1.1","2.10.0","2.11.0","2.2.0","2.2.1","2.2.2","2.3.0","2.4.0","2.4.1","2.5.0","2.5.1","2.6.0","2.7.0","2.8.0","2.9.0","2.9.1","3.0.0","3.0.1","3.0.2","3.1.0","3.2.0","3.3.0","3.3.1","3.4.0","3.5.0","3.5.1","4.0.0","4.0.0rc1","4.0.1","4.1.0","4.1.1","4.10.0","4.10.1","4.10.2","4.10.3","4.11.0","4.11.1","4.11.2","4.11.3","4.12.0","4.12.1","4.12.2","4.12.3","4.12.4","4.12.5","4.13.0","4.14.0","4.14.1","4.15.0","4.16.0","4.16.1","4.16.2","4.17.0","4.18.0","4.19.0","4.19.1","4.19.2","4.19.3","4.19.4","4.2.0","4.2.1","4.2.2","4.20.0","4.20.1","4.21.0","4.21.1","4.21.2","4.21.3","4.22.0","4.22.1","4.22.2","4.23.0","4.23.1","4.24.0","4.25.0","4.25.1","4.26.0","4.26.1","4.27.0","4.27.1","4.27.2","4.27.3","4.27.4","4.28.0","4.28.1","4.29.0","4.29.1","4.29.2","4.3.0","4.3.0rc1","4.3.1","4.3.2","4.3.3","4.30.0","4.30.1","4.30.2","4.31.0","4.32.0","4.32.1","4.33.0","4.33.1","4.33.2","4.33.3","4.34.0","4.34.1","4.35.0","4.35.1","4.35.2","4.36.0","4.36.1","4.36.2","4.37.0","4.37.1","4.37.2","4.38.0","4.38.1","4.38.2","4.39.0","4.39.1","4.39.2","4.39.3","4.4.0","4.4.1","4.4.2","4.40.0","4.40.1","4.40.2","4.41.0","4.41.1","4.41.2","4.42.0","4.42.1","4.42.2","4.42.3","4.42.4","4.43.0","4.43.1","4.43.2","4.43.3","4.43.4","4.44.0","4.44.1","4.44.2","4.45.0","4.45.1","4.45.2","4.46.0","4.46.1","4.46.2","4.46.3","4.47.0","4.47.1","4.48.0","4.48.1","4.48.2","4.48.3","4.49.0","4.5.0","4.5.1","4.50.0","4.50.1","4.50.2","4.50.3","4.51.0","4.51.1","4.51.2","4.51.3","4.52.0","4.52.1","4.52.2","4.52.3","4.52.4","4.53.0","4.53.1","4.53.2","4.53.3","4.54.0","4.54.1","4.55.0","4.55.1","4.55.2","4.55.3","4.55.4","4.56.0","4.56.1","4.56.2","4.57.0","4.57.1","4.57.2","4.57.3","4.57.4","4.57.5","4.57.6","4.6.0","4.6.1","4.7.0","4.8.0","4.8.1","4.8.2","4.9.0","4.9.1","4.9.2","5.0.0rc0","5.0.0rc1","5.0.0rc2","5.0.0rc3"]}],"products":[{"vendor":"huggingface","product":"huggingface/transformers"},{"vendor":"huggingface","product":"transformers"}],"references":[{"url":"https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485","tags":["exploit","Exploit","Third Party Advisory","web","evidence"]},{"url":"https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396","tags":["Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-1839","tags":["advisory"]},{"url":"https://github.com/huggingface/transformers/releases/tag/v5.0.0rc3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-69w3-r845-3855","tags":["advisory"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/1xxx/CVE-2026-1839.json","tags":["advisory"]},{"url":"https://github.com/huggingface/transformers","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-1839","title":"Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers","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\u003e=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.","status":"published","published":"2026-04-07T05:22:00.959Z","modified":"2026-04-07T13:27:41.789Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:20:01.618694Z"}],"euvd":[{"id":"EUVD-2026-19573","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\u003e=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.","status":"published","published":"2026-04-07T05:22:00Z","modified":"2026-04-07T13:27:41Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium"}],"updated_at":"2026-11-02T19:25:14.820353Z"}],"ghsa":[{"id":"GHSA-69w3-r845-3855","title":"HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class","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\u003e=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.","status":"published","published":"2026-04-07T06:30:28Z","modified":"2026-04-08T00:17:59Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:39:51.193071Z"}],"nvd":[{"id":"CVE-2026-1839","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\u003e=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.","status":"published","published":"2026-04-07T06:16:41.49Z","modified":"2026-10-26T22:10:00.163Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high","assessor":"primary"},{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium","assessor":"secondary"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T14:12:13.1424Z"}],"osv":[{"id":"CVE-2026-1839","title":"Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers","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\u003e=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.","status":"published","published":"2026-04-07T05:22:00.959Z","modified":"2026-10-28T02:30:42.509447413Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:44:58.024074Z"},{"id":"GHSA-69w3-r845-3855","title":"HuggingFace Transformers allows for arbitrary code execution in the `Trainer` class","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\u003e=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.","status":"published","published":"2026-04-07T06:30:28Z","modified":"2026-09-10T03:50:43.300048881Z","cvss":[{"version":"3.0","score":6.5,"vector":"CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H","level":"medium"}],"cwes":["CWE-502"],"updated_at":"2026-11-02T15:46:39.618611Z"},{"id":"PYSEC-2026-2288","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\u003e=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.","status":"published","published":"2026-04-07T06:16:41.49Z","modified":"2026-07-13T16:45:06.516869221Z","cvss":[{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","level":"high"}],"updated_at":"2026-11-02T15:52:55.537808Z"},{"id":"CLSA-2026-1779065183","title":"TuxCare security update for transformers (1 CVE)","description":"TuxCare rebuilt transformers to address 1 CVE. Fixed in 4.57.6.post1+tuxcare.","status":"published","published":"2026-08-04T14:52:31Z","modified":"2026-10-15T09:48:01.153417341Z","updated_at":"2026-11-02T15:43:44.737408Z"}]}}
