CVE-2025-46567
HIGH 7.8CVSS 3.1LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
LLama Factory enables fine-tuning of large language models. Prior to version 1.0.0, a critical vulnerability exists in the llamafy_baichuan2.py script of the LLaMA-Factory project. The script performs insecure deserialization using torch.load() on user-supplied .bin files from an input directory. An attacker can exploit this behavior by crafting a malicious .bin file that executes arbitrary commands during deserialization. This issue has been patched in version 1.0.0.
- Published
- 1 May 2025
- Last modified
- 10 Sep 2026
- Assigned by
- security-advisories@github.com
- NVD status
- Analyzed
- Weakness
- CWE-502
- Also known as
- GHSA-f2f7-gj54-6vpvPYSEC-2026-1574
- Sources
- NVDJSONOSV GHSA-f2f7-gj54-6vpvJSONOSV PYSEC-2026-1574JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | security-advisories@github.com (Secondary) | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L |
| OSV | GitHub | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L |
| OSV | PyPA | CVSS 3.1 | MEDIUM 6.1 | CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | hiyouga | llama-factorycpe:2.3:a:hiyouga:llama-factory:*:*:*:*:*:*:*:* |
< 1.0.0 | 1.0.0 |
| OSV | PyPI | llamafactory | < 0.9.3 | 0.9.3 |
References
- https://github.com/hiyouga/LLaMA-Factory/commit/2989d39239d2f46e584c1e1180ba46b9768afb2a · Patch, WEB
- https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-f2f7-gj54-6vpv · Exploit, Vendor Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-46567 · ADVISORY
- https://github.com/hiyouga/LLaMA-Factory · PACKAGE
- https://github.com/hiyouga/LLaMA-Factory/blob/main/scripts/convert_ckpt/llamafy_baichuan2.py#L35 · WEB
- https://pypi.org/project/llamafactory · PACKAGE
- https://github.com/advisories/GHSA-f2f7-gj54-6vpv · ADVISORY
History
- 25 Nov 2026 20:58 UTC · NVD: first stored (published 1 May 2025)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 7 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 23 Apr 2025)