Cyber Resilience

CVE-2025-53002

RCE in Hiyouga Llama-Factory ≤ 0.9.4

Published
26 June 2025
Modified
17 June 2026
Patch / advisory
CVSS Score v3.1 8.3
Click a component to see what it means
Raw vectorCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H
EPSS Score 0.011 61th percentile
Risk Priority 67 floored blend · peak EPSS

Summary

CVE-2025-53002 is a high-severity Code Injection (CWE-94) vulnerability in Hiyouga Llama-Factory. Its CVSS base score is 8.3 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Command and Scripting Interpreter (T1059); ranked in the top 39% of CVEs by exploit likelihood; it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

The strongest mitigations our analysis identified map to SA-11 (Developer Testing and Evaluation) and SI-10 (Information Input Validation) — see the control section below for these in your framework.

Deeper analysis AI-assisted summary

Synthesised by an AI model from the NVD description and linked references — a reading aid, not an authoritative source.

LLaMA-Factory, a tuning library for large language models, is affected by a remote code execution vulnerability in all versions through 0.9.3. The flaw occurs during the training process when the vhead_file argument is deserialized without the weights_only=True safeguard, enabling unsafe loading of untrusted checkpoint data and triggering arbitrary code execution on the host.

An authenticated user who can reach the WebUI can exploit the issue by supplying a malicious Checkpoint path parameter. This action causes the application to load attacker-controlled code stealthily during training, granting the ability to execute arbitrary commands with the privileges of the training process while leaving the victim unaware of the activity.

The associated GitHub security advisory and the patch commit in version 0.9.4 state that the fix consists of enforcing the weights_only=True parameter when the vhead_file is loaded, thereby preventing deserialization of untrusted objects.

The EPSS score remains flat at 0.0422 with no material increase after disclosure.

OWASP Top 10 for Web (2025)

EU & UK References

Vulnerability Data

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,…

more

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.

CWE(s)

Related Threats

MITRE ATT&CK Enterprise Techniques

T1059 Command and Scripting Interpreter Execution
Adversaries may abuse command and script interpreters to execute commands, scripts, or binaries.
T1059.001 PowerShell Execution
Adversaries may abuse PowerShell commands and scripts for execution.
T1059.002 AppleScript Execution
Adversaries may abuse AppleScript for execution.
T1059.004 Unix Shell Execution
Adversaries may abuse Unix shell commands and scripts for execution.
T1059.005 Visual Basic Execution
Adversaries may abuse Visual Basic (VB) for execution.
T1059.006 Python Execution
Adversaries may abuse Python commands and scripts for execution.
Derived from this CVE’s CWE(s) via the direct CWE→ATT&CK cross-walk.

CVEs Like This One

CVE-2026-58116Same product: Hiyouga Llama-Factory
CVE-2023-26436Shared CWE-502, CWE-94
CVE-2024-10382Shared CWE-502, CWE-94
CVE-2025-51427Shared CWE-502, CWE-94
CVE-2025-57773Shared CWE-502, CWE-94
CVE-2026-11860Shared CWE-502, CWE-94
CVE-2026-58025Shared CWE-502, CWE-94
CVE-2021-29505Shared CWE-502, CWE-94
CVE-2025-69872Shared CWE-502, CWE-94
CVE-2026-31253Shared CWE-502, CWE-94

Affected Assets

hiyouga
llama-factory
≤ 0.9.4

Mitigating Controls

Control response

Prevent
Stop it (NIST 800-53)

Detect
Catch it (NIST detect / respond)

Harden
Shrink the surface (DISA STIG)

Validate
Prove the fix (OWASP ASVS)
  • V1.3.1

Mitigating Controls (NIST 800-53 r5) AI

Developer testing and evaluation finds code paths that accept and execute externally influenced strings.

Input validation directly stops untrusted data from being used to construct executable code without neutralization.

Least privilege limits the damage an injected code fragment can perform once executed.

Requiring documented secure development standards and tools enforces use of safe code-generation APIs and escaping.

Engineering principles such as safe deserialization and input sanitization structurally prevent the weakness from being introduced.

Integrity verification tools can detect malformed or tampered serialized data after the fact.

Mitigating Controls (NIST CSF 2.0) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→CSF cross-walk (authority under review) — links open the control.

PR.PS-06 mostly match
prevents

PR.PS-06's SDLC practices directly target injection flaws via secure coding and testing (mostly), yet as a single broad outcome it leaves many code-generation specifics unaddressed (partial).

PR.DS-10 none match
prevents

PR.DS-10 protects runtime data confidentiality/integrity but has no bearing on neutralizing externally influenced input during code generation, so neither direction shows any preventive effect.

PR.PS-02 none match
prevents

PR.PS-02 addresses only post-deployment updates/patching and cannot prevent introduction of unsafe deserialization code, yet it can remediate some instances when the flaw exists in outdated libraries or components.

Mitigating Controls (ISO/IEC 27001:2022 Annex A) AI

Derived directly from the weakness types (CWEs) cited in the NVD entry via our AI-authored CWE→ISO cross-walk (authority under review) — links open the control.

finds

Security testing includes validation of deserialization routines and the use of untrusted data, reducing the likelihood that unsafe object reconstruction will be deployed.

prevents

Banning unapproved code samples and unauthenticated web services, combined with secure-coding standards and SAST, prevents the dynamic generation or inclusion of attacker-supplied code.

finds

Regular scanning of third-party libraries and timely patching reduce the likelihood that unsafe deserialization vulnerabilities remain active.

none

Controls that restrict unauthorized or malicious code from being introduced via external networks or removable media limit opportunities for an attacker to inject and execute arbitrary code.

References