vllm: Malicious model to RCE by torch.load in hf_model_weights_iterator
Description
The vllm/model_executor/weight_utils.py implements hf_model_weights_iterator to load the model checkpoint, which is downloaded from huggingface. It use torch.load function and weights_only parameter is default value False. There is a security warning on https://pytorch.org/docs/stable/generated/torch.load.html, when torch.load load a malicious pickle data it will execute arbitrary code during unpickling.
Impact
This vulnerability can be exploited to execute arbitrary codes and OS commands in the victim machine who fetch the pretrained repo remotely.
Note that most models now use the safetensors format, which is not vulnerable to this issue.
References
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | vllm | < 0.7.0 | 0.7.0 |
References
- https://github.com/vllm-project/vllm/security/advisories/GHSA-rh4j-5rhw-hr54
- https://github.com/vllm-project/vllm/commit/d3d6bb13fb62da3234addf6574922a4ec0513d04
- https://github.com/vllm-project/vllm/pull/12366
- https://pytorch.org/docs/stable/generated/torch.load.html
- https://nvd.nist.gov/vuln/detail/CVE-2025-24357
- https://github.com/pypa/advisory-database/tree/main/vulns/vllm/PYSEC-2025-58.yaml
- https://github.com/vllm-project/vllm
- https://github.com/vllm-project/vllm/releases/tag/v0.7.0
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-502- Platform
- Python (PyPI)
- Package
vllm- Disclosed
- 27.01.2025
- Updated
- 11.10.2026 14:19
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2025-58 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-rh4j-5rhw-hr54 - CC BY 4.0
Vulnerability history: vllm
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 94
- First → latest
- 09.2024 10.2026
- Without a fix
- 5
- Exploited in attacks
- 0
Severity breakdown
- Critical 9
- High 23
- Medium 47
- Low 4
- Unrated 11
Disclosures per year
- 2024: 2
- 2025: 30
- 2026: 62
-
vllm: Malicious model to RCE by torch.load in hf_model_weights_iterator this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.