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.

Severity (CVSS 3.1)6.1Medium
Exploit odds (30 days)0.3%top 78.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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

EcosystemPackageFixed inAdvisory
PyPIllamafactory0.9.3GHSA-f2f7-gj54-6vpv
PyPIllamafactory0.9.3PYSEC-2026-1574

Affected products (as reported)

VendorProductVersions
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

References