CVE-2025-46567
Hiyouga Llama-factory vulnerability
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 products
Llama-factory. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Hiyouga Llama-factory runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Set the orderSystems that can be reached from the internet come first, then the rest.
References
- github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-f2f7-gj54-6vpv · Exploit
- github.com/hiyouga/LLaMA-Factory/commit/2989d39239d2f46e584c1e1180ba46b9768afb2a · Patch
- github.com/hiyouga/LLaMA-Factory/blob/main/scripts/convert_ckpt/llamafy_baichuan2.py#L35
- nvd.nist.gov/vuln/detail/CVE-2025-46567
- github.com/advisories/GHSA-f2f7-gj54-6vpv
- nvd.nist.gov/vuln/detail/CVE-2025-46567
- cve.org/CVERecord?id=CVE-2025-46567
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.