CVE-2026-58116: Inclusion of Functionality from Untrusted Control Sphere in hiyouga LlamaFactory
LLaMA-Factory through 0.9.5 contains a remote code execution vulnerability that allows attackers with WebUI access to execute arbitrary Python code by supplying a malicious model path in the Chat or Training interfaces. The application passes user-supplied model path input unvalidated into AutoTokenizer.from_pretrained() and AutoModel.from_pretrained() with a hardcoded trust_remote_code=True parameter, causing the Hugging Face transformers library to fetch and execute arbitrary code from a remote or local model repository with the privileges of the server process.
AI Analysis
Technical Summary
CVE-2026-58116 affects hiyouga's LLaMA-Factory through version 0.9.5. The vulnerability allows remote code execution by an attacker who has access to the WebUI. The application accepts a user-supplied model path and passes it unvalidated to Hugging Face transformers library functions AutoTokenizer.from_pretrained() and AutoModel.from_pretrained() with the parameter trust_remote_code=True. This setting causes the library to fetch and execute arbitrary code from the specified model repository, which can be remote or local, under the privileges of the server process. This leads to a critical security risk of arbitrary code execution on the server.
Potential Impact
An attacker with WebUI access can execute arbitrary Python code on the server hosting LLaMA-Factory, potentially leading to full system compromise. The vulnerability is critical due to the lack of required privileges or user interaction and the high impact on confidentiality, integrity, and availability of the affected system.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict or disable WebUI access to trusted users only. Avoid supplying untrusted model paths to the application. Monitor vendor channels for official patches or updates addressing this vulnerability.
CVE-2026-58116: Inclusion of Functionality from Untrusted Control Sphere in hiyouga LlamaFactory
Description
LLaMA-Factory through 0.9.5 contains a remote code execution vulnerability that allows attackers with WebUI access to execute arbitrary Python code by supplying a malicious model path in the Chat or Training interfaces. The application passes user-supplied model path input unvalidated into AutoTokenizer.from_pretrained() and AutoModel.from_pretrained() with a hardcoded trust_remote_code=True parameter, causing the Hugging Face transformers library to fetch and execute arbitrary code from a remote or local model repository with the privileges of the server process.
CVSS v4.0
Score 9.3critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-58116 affects hiyouga's LLaMA-Factory through version 0.9.5. The vulnerability allows remote code execution by an attacker who has access to the WebUI. The application accepts a user-supplied model path and passes it unvalidated to Hugging Face transformers library functions AutoTokenizer.from_pretrained() and AutoModel.from_pretrained() with the parameter trust_remote_code=True. This setting causes the library to fetch and execute arbitrary code from the specified model repository, which can be remote or local, under the privileges of the server process. This leads to a critical security risk of arbitrary code execution on the server.
Potential Impact
An attacker with WebUI access can execute arbitrary Python code on the server hosting LLaMA-Factory, potentially leading to full system compromise. The vulnerability is critical due to the lack of required privileges or user interaction and the high impact on confidentiality, integrity, and availability of the affected system.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, restrict or disable WebUI access to trusted users only. Avoid supplying untrusted model paths to the application. Monitor vendor channels for official patches or updates addressing this vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-06-29T14:13:18.383Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a43c34a27e9c79719d5be1b
Added to database: 06/30/2026, 13:23:22 UTC
Last enriched: 06/30/2026, 13:36:38 UTC
Last updated: 06/30/2026, 15:06:36 UTC
Views: 5
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.