{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2026-1839","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>=2.2` when used with PyTorch versions below 2.6, as the `safe_g","descriptionLong":"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.","published":"2026-04-07T05:22:00.959Z","updated":"2026-10-28T02:30:42.509447413Z","reserved":"2026-02-03T16:49:27.781Z","status":"Analyzed","rejected":false,"assigner":"@huntr_ai","metric":{"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","rating":"high","source":"NVD"},"metrics":[{"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","rating":"high","source":"NVD"},{"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","rating":"high","source":"OSV"},{"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","rating":"medium","source":"@huntr_ai"},{"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","rating":"medium","source":"huntr.dev"},{"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","rating":"medium","source":"OSV"},{"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","rating":"medium","source":"GitHub"}],"rating":"high","products":["huggingface/transformers"],"affectedProducts":[{"vendor":"huggingface","product":"huggingface/transformers","defaultStatus":null,"versions":[{"version":"unspecified","lessThan":"v5.0.0rc3","status":"affected","versionType":"custom"}],"platforms":[]}],"packages":[{"ecosystem":"PyPI","name":"transformers","purl":"pkg:pypi/transformers","ranges":["<5.0.0rc3","<5.0.0"],"fixed":["5.0.0rc3","5.0.0"],"advisory":"GHSA-69w3-r845-3855"}],"cwes":["CWE-502"],"aliases":["GHSA-69w3-r845-3855","PYSEC-2026-2288"],"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://github.com/CVEProject/cvelistV5/tree/main/cves/2026/1xxx/CVE-2026-1839.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-1839","tags":["advisory"]},{"url":"https://github.com/huggingface/transformers","tags":["package"]},{"url":"https://github.com/huggingface/transformers/releases/tag/v5.0.0rc3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-69w3-r845-3855","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"total"},"epss":0.00388,"epssPercentile":0.33624,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-1839","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-1839","ok":true,"note":"Analyzed"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2026-1839","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-69w3-r845-3855","ok":true,"note":"GHSA-69w3-r845-3855"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-1839","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}