Skip to content
OpenAdvisories
Medium · 6.1 CVE-2025-46567 EUVD-2025-12156GHSA-f2f7-gj54-6vpvPYSEC-2026-1574

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

Published May 1, 2025 · Updated May 2, 2025 · 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.

Affected products

VendorProductAffectedFixed
hiyouga LLaMA-Factory < 1.0.0 —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI llamafactory < 0.9.3 0.9.3 GHSA-f2f7-gj54-6vpv

References