Vulnerability · Published May 1, 2025 · Assigned by GitHub_M
CVE-2025-46567LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
Medium 6.1
In plain English
A medium-severity unsafe deserialization in LLaMA-Factory from hiyouga. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 21% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | llamafactory | 0.9.3 | GHSA-f2f7-gj54-6vpv |
| PyPI | llamafactory | 0.9.3 | PYSEC-2026-1574 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| hiyouga | LLaMA-Factory | < 1.0.0 |
Weakness: CWE-502 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L