Skip to content

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

HighCVSS 7.8 EPSS 0.29%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: partial

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.

Upgrade path

2 packages: 2 fixed.

PackageAffectedFixed inStatus
hiyouga LLaMA-Factory < 1.0.0; = < 1.0.0 1.0.0 Fixed
pypi llamafactory(PyPI) < 0.9.3; <= 0.9.2; = 0.7.1; = 0.8.0 +6 more 0.9.3 Fixed

Affected products

ProductAffected versionsFixed in
pypi llamafactory(PyPI) < 0.9.3 0.9.3
pypi llamafactory(PyPI) = 0.7.1 No fix listed
pypi llamafactory(PyPI) = 0.8.0 No fix listed
pypi llamafactory(PyPI) = 0.8.1 No fix listed
pypi llamafactory(PyPI) = 0.8.2 No fix listed
pypi llamafactory(PyPI) = 0.8.3 No fix listed
pypi llamafactory(PyPI) = 0.9.0 No fix listed
pypi llamafactory(PyPI) = 0.9.1 No fix listed
pypi llamafactory(PyPI) = 0.9.2 No fix listed
pypi llamafactory(PyPI) <= 0.9.2 No fix listed
hiyouga LLaMA-Factory = < 1.0.0 No fix listed
hiyouga LLaMA-Factory < 1.0.0 1.0.0

References