Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. llamafactory
  4. ›
  5. CVE-2025-53002

CVE-2025-53002: LLaMA-Factory allows Code Injection through improper vhead_file safeguards

June 27, 2025

A critical remote code execution vulnerability was discovered 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.

Note: In torch versions <2.6, the default setting is weights_only=False, and Llama Factory’s setup.py only requires torch>=2.0.0.

References

  • github.com/advisories/GHSA-xj56-p8mm-qmxj
  • github.com/hiyouga/LLaMA-Factory
  • github.com/hiyouga/LLaMA-Factory/commit/bb7bf51554d4ba8432333c35a5e3b52705955ede
  • github.com/hiyouga/LLaMA-Factory/security/advisories/GHSA-xj56-p8mm-qmxj
  • nvd.nist.gov/vuln/detail/CVE-2025-53002

Code Behaviors & Features

Detect and mitigate CVE-2025-53002 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions up to 0.9.3

Solution

Unfortunately, there is no solution available yet.

Impact 8.3 HIGH

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

Learn more about CVSS

Weakness

  • CWE-94: Improper Control of Generation of Code ('Code Injection')

Source file

pypi/llamafactory/CVE-2025-53002.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:16:57 +0000.