CVE-2025-24357: vLLM allows a malicious model RCE by torch.load in hf_model_weights_iterator
Description The vllm/modelexecutor/weightutils.py implements hfmodelweightsiterator to load the model checkpoint, which is downloaded from huggingface. It use torch.load function and weightsonly 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 https://pytorch.org/docs/stable/generated/torch.load.html Fix: https://github.com/vllm-project/vllm/pull/12366
Other sources
vLLM is a library for LLM inference and serving. vllm/modelexecutor/weightutils.py implements hfmodelweightsiterator to load the model checkpoint, which is downloaded from huggingface. It uses the torch.load function and the weightsonly parameter defaults to False. When torch.load loads malicious pickle data, it will execute arbitrary code during unpickling. This vulnerability is fixed in v0.7.0.
— MITRE
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2025-24357?
CVE-2025-24357 has a moderate severity rating due to the potential for security risks associated with model checkpoint loading.
How do I fix CVE-2025-24357?
To fix CVE-2025-24357, upgrade to vllm version 0.7.0 or higher.
What versions of vllm are affected by CVE-2025-24357?
CVE-2025-24357 affects all versions of vllm prior to version 0.7.0.
What components are impacted by CVE-2025-24357?
CVE-2025-24357 impacts the hf_model_weights_iterator function in the vllm/model_executor/weight_utils.py module.
Is vllm safe to use with CVE-2025-24357?
Using versions of vllm below 0.7.0 may pose security risks due to CVE-2025-24357.