Skip to main content
Meet us at Black Hat USA 2026— Las Vegas, August 1–6Book a Meeting
Mallory
UnratedPublic exploit

RCE in LLaMA-Factory WebUI model loading

IdentifiersCVE-2026-58116CWE-94

CVE-2026-58116 is a remote code execution vulnerability affecting LLaMA-Factory through version 0.9.5. In the WebUI Chat and Training interfaces, attacker-controlled model path input is passed without validation into Hugging Face transformers loading functions, specifically AutoTokenizer.from_pretrained() and AutoModel.from_pretrained(). The vulnerable code path hardcodes trust_remote_code=True, which allows transformers to fetch and execute Python code from a referenced remote or local model repository. By supplying a malicious model path, an attacker with WebUI access can cause arbitrary Python code to execute in the context of the LLaMA-Factory server process.

Share:
For your environment

Are you exposed to this one?

Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.

ANALYST BRIEF

Impact, mitigation & remediation

What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.

Impact

What an attacker gets, and what they’ve been doing with it.

Successful exploitation results in arbitrary Python code execution on the host running LLaMA-Factory with the privileges of the server process. This can enable full compromise of the application context, including theft or modification of data accessible to the process, tampering with models or training jobs, installation of persistence, lateral movement from the host, and potential broader system compromise depending on the server's privileges and environment.

Mitigation

If you can’t patch tonight, do this now.

Restrict WebUI access to authorized users only until a patch is applied. Prevent users from supplying arbitrary model paths in Chat and Training workflows. Where operationally feasible, disable remote code trust behavior in transformers and only permit loading from vetted model repositories or controlled local paths. Additional hardening should include running the service with minimal privileges and isolating the workload to reduce blast radius.

Remediation

Patch, then assume compromise.

Upgrade to a fixed release newer than 0.9.5 once available. In the application, validate and strictly sanitize all user-supplied model path input before passing it to model-loading routines. Remove or disable trust_remote_code=True for untrusted model sources wherever possible, and ensure model loading is limited to approved repositories or local allowlisted paths.
PUBLIC EXPLOITS

Exploits

No public exploits tracked yet. Mallory keeps watching.

VALID 0 / 0 TOTALView more in app

No public exploit code observed for this vulnerability.

EXPOSURE SURFACE

Affected products & vendors

Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.

VendorProductType
HiyougaLlama-Factoryapplication

Vendor-confirmed product mapping. Mallory continuously reconciles this list against your asset inventory.

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which adversaries are exploiting it right now, which detections to deploy, and what to do tonight.
Exposure mapping

Query your assets running an affected version, and investigate the blast radius.

Threat actor evidence

Every observed campaign linking this CVE to a named adversary.

Associated malware

Malware families riding this exploit, with evidence and IOCs.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

Vendor-by-vendor mapping

Cross-references every affected SKU, including bundled OEM variants.

Social activity1

Community discussion across Reddit, Mastodon, and other social sources.