CVE-2025-53002
LLaMA-Factory allows Code Injection through improper vhead_file safeguards
Severity by source
Trivy's own label is CRITICAL. Rated critical by NVD. Rated lower by GHSA (high).
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.
Affected packages and fixed versions
| Source | Package | Fixed in |
|---|---|---|
| pip::GitHub Security Advisory pip | llamafactory | no fix listed |
References
- https://drive.google.com/file/d/1AddKm2mllsXfuvL4Tvbn_WJdjEOYXx4y/view?usp=sharing
- https://github.com/hiyouga/LLaMA-Factory
- https://github.com/hiyouga/LLaMA-Factory/commit/bb7bf51554d4ba8432333c35a5e3b52705955ede
- https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-xj56-p8mm-qmxj
- https://nvd.nist.gov/vuln/detail/CVE-2025-53002