# CVE-2025-46567: LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py

- Severity: Medium 6.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.29%, higher than 23% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2025-04-23T22:21:13.000Z
- Modified: 2026-09-10T03:50:23.927Z
- Also known as: GHSA-f2f7-gj54-6vpv, PYSEC-2026-1574
- Weaknesses: CWE-502
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- hiyouga LLaMA-Factory: < 1.0.0; before 1.0.0
- llamafactory (PyPI): before 0.9.3

## Every score

- GitHub_M: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L`
- GitHub: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 6.1 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L`

## References

- <https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-f2f7-gj54-6vpv> (exploit, vendor-advisory, web)
- <https://github.com/hiyouga/LLaMA-Factory/commit/2989d39239d2f46e584c1e1180ba46b9768afb2a> (patch, 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)

## Sources

- CVE List: [CVE-2025-46567](https://www.cve.org/CVERecord?id=CVE-2025-46567), CVE Terms of Use, modified 2025-05-02
- GitHub Advisory Database: [GHSA-f2f7-gj54-6vpv](https://github.com/advisories/GHSA-f2f7-gj54-6vpv), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2025-46567](https://nvd.nist.gov/vuln/detail/CVE-2025-46567), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2026-1574](https://osv.dev/vulnerability/PYSEC-2026-1574), CC-BY-4.0, modified 2026-07-07

---

Page: https://cve.day/CVE-2025-46567 · Whole record: https://cve.day/CVE-2025-46567.json · Rebuilt by cve.day 2026-11-25T22:58:57.372Z
