CVE-2024-52803 LLama Factory Remote OS Command Injection Vulnerability

High 7.5 Published Updated

Attackers can execute arbitrary OS commands on the host system via unsanitized input in the training process of this LLM fine-tuning library.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-52803?

CVE-2024-52803 is a high-severity command injection vulnerability in hiyouga LLaMA-Factory, published on 21 Nov 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

LLama Factory enables fine-tuning of large language models. A critical remote OS command injection vulnerability has been identified in the LLama Factory training process. This vulnerability arises from improper handling of user input, allowing malicious actors to execute arbitrary OS commands on the host system. The issue is caused by insecure usage of the `Popen` function with `shell=True`, coupled with unsanitized user input. Immediate remediation is required to mitigate the risk. This vulnerability is fixed in 0.9.1.

Weakness: CWE-78, CWE-79

Which versions are affected by CVE-2024-52803?

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

PackageAffectedFixed in
llamafactory PyPIAll versions0.9.1
llamafactory PyPIAll versions0.9.1
llamafactory PyPIAll versions0.9.1

Products include Hiyouga Llama-Factory.

How do I fix CVE-2024-52803?

Upgrade llamafactory to 0.9.1 or later.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2024-52803 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-52803 exists.

Sources

Also known as GHSA-hj3w-wrh4-44vp, PYSEC-2026-1575.

Is CVE-2024-52803 in your software?

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

Check your SBOMs for free