CVE-2025-53002 LLaMA-Factory Remote Code Execution (RCE) Vulnerability

High 8.3 Published Updated

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.

Weakness: CWE-94, CWE-502

Which versions are affected by CVE-2025-53002?

3 open source packages ship an affected version, including llamafactory. It affects 1 product.

PackageAffectedFixed in
llamafactory PyPIAll versions to 0.9.3None
llamafactory PyPIAll versions to 0.9.3None
llamafactory PyPIAll versions to 0.9.3None

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.

Sources

Also known as GHSA-xj56-p8mm-qmxj, PYSEC-2026-1576.

Is CVE-2025-53002 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free