LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
Key facts
- Attack vector
- Local
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- Low
- Impact type
- Code execution
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-502.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| hiyouga | LLaMA-Factory | before 1.0.0 | 1.0.0 | Patch available | CNA |
| — | llamafactory (PyPI) | before 0.9.3 | 0.9.3 | Patch available | GHSA-f2f7-gj54-6vpv |
- LLaMA-Factory Vendorhiyouga Affected before 1.0.0 Fixed in 1.0.0 Patch available CNA
- llamafactory (PyPI) Vendor— Affected before 0.9.3 Fixed in 0.9.3 Patch available GHSA-f2f7-gj54-6vpv
Remediation
- Fix · CNA LLaMA-Factory (hiyouga) Fixed in 1.0.0
- Fix · GHSA-f2f7-gj54-6vpv llamafactory (PyPI) Fixed in 0.9.3 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2025-46567
- 2026-10-03 Alias added: GHSA-f2f7-gj54-6vpv
References
More hiyouga Llama-factory vulnerabilities
- TI-2026-41855 LLaMA-Factory 0.9.5 Remote Code Execution via WebUI Model Path CVSS 4.0CRITICAL 9.3
- TI-2024-35316 LLama Factory Remote OS Command Injection Vulnerability CVSS 3.1CRITICAL 9.8
- TI-2025-33006 LLaMA-Factory Remote Code Execution (RCE) Vulnerability CVSS 3.1CRITICAL 9.8
- TI-2025-38177 LLaMA Factory's Chat API has Critical SSRF and LFI Vulnerabilities CVSS 3.1HIGH 8.1
Sources
- CVE-2025-46567 · CVE Program
- CVE-2025-46567 · NVD
- FIRST EPSS
- GHSA-f2f7-gj54-6vpv · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences