Code execution via unrestricted torch.load deserialization
Published May 1, 2025 · Updated May 2, 2025
Unsafe deserialization in hiyouga LlamaFactory 0.9.2 and earlier allows context-dependent attackers to execute commands via crafted .bin files. The save_weight function in scripts/convert_ckpt/llamafy_baichuan2.py passes every .bin file from --input_dir to torch.load without weights_only=True, allowing pickle reducers to invoke commands. Exploitation requires a user to obtain an attacker-controlled project directory and run the converter against it, after which commands execute with that user's privileges.
Summary
What happened
Unsafe deserialization in hiyouga LlamaFactory 0.9.2 and earlier allows context-dependent attackers to execute commands via crafted .bin files. The save_weight function in scripts/convert_ckpt/llamafy_baichuan2.py passes every .bin file from --input_dir to torch.load without weights_only=True, allowing pickle reducers to invoke commands. Exploitation requires a user to obtain an attacker-controlled project directory and run the converter against it, after which commands execute with that user's privileges.
The record
- CVE
- CVE-2025-46567
- Published
- May 1, 2025
- Updated
- May 2, 2025
- Vendor
- hiyouga
- Product
- LlamaFactory
- Classifications
- CWE-502, T1204.002
- Attack vector
- local
- Privileges
- unauthenticated
Timeline
How it unfolded
- May 1, 2025CVE publishedPublication date reported by the CVE source.
- May 2, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=< 1.0.0
What conditions does exploitation require?
What is affected?
Published CVSS scores
CVSS describes severity. EPSS estimates exploitation probability.
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Public exploit references
- GHSA-f2f7-gj54-6vpv checkpoint proof of conceptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo