CVE-2025-53002 LLaMA-Factory Remote Code Execution (RCE) Vulnerability
Attackers can execute arbitrary code on the host system by providing a malicious checkpoint path via the WebUI interface in LLaMA-Factory.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- None listed
What is CVE-2025-53002?
CVE-2025-53002 is a high-severity unsafe deserialization vulnerability in hiyouga LLaMA-Factory, published on 26 Jun 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
LLaMA-Factory is a tuning library for large language models. A remote code execution vulnerability was discovered in LLaMA-Factory versions up to and including 0.9.3 during the LLaMA-Factory training process. This vulnerability arises because the `vhead_file` is loaded without proper safeguards, allowing malicious attackers to execute arbitrary malicious code on the host system simply by passing a malicious `Checkpoint path` parameter through the `WebUI` interface. The attack is stealthy, as the victim remains unaware of the exploitation. The root cause is that the `vhead_file` argument is loaded without the secure parameter `weights_only=True`. Version 0.9.4 contains a fix for the issue.
Which versions are affected by CVE-2025-53002?
3 open source packages ship an affected version, including llamafactory. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
llamafactory PyPI | All versions to 0.9.3 | None |
llamafactory PyPI | All versions to 0.9.3 | None |
llamafactory PyPI | All versions to 0.9.3 | None |
Products include Hiyouga Llama-Factory.
How do I fix CVE-2025-53002?
No fix has been published for CVE-2025-53002 yet. Limit exposure of the affected software until one is available.
Upgrade, and only deserialise data from trusted sources or with an allow-list of types. More about Unsafe deserialization.
Is CVE-2025-53002 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-53002 exists.
Other vulnerabilities in hiyouga LLaMA-Factory
- CVE-2026-58116 LLaMA-Factory 0.9.5 Remote Code Execution via WebUI Model Path
- CVE-2025-61784 LLaMA Factory's Chat API has Critical SSRF and LFI Vulnerabilities
- CVE-2024-52803 LLama Factory Remote OS Command Injection Vulnerability
- CVE-2025-46567 LLaMA-Factory Allows Arbitrary Code Execution via Unsafe Deserialization in Ilamafy_baichuan2.py
Sources
Also known as GHSA-xj56-p8mm-qmxj, PYSEC-2026-1576.