NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · vLLM

CVE-2025-24357: vllm: Malicious model to RCE by torch.load in hf_model_weights_iterator

highCVSS 3.1 7.5GHSA-rh4j-5rhw-hr54

vLLM before 0.7.0 loads model checkpoints with torch.load without weights_only, so a malicious pickle-format checkpoint from Hugging Face runs arbitrary code on the machine that loads it. Models in safetensors format are not affected. Upgrade to vLLM 0.7.0.

Published Jan 27, 2025 · Updated Jun 30, 2025 · Analysis Nov 1, 2026

What an attacker can do

hf_model_weights_iterator in vllm/model_executor/weight_utils.py loads the downloaded checkpoint with torch.load, and weights_only was left at its default of False. PyTorch warns that unpickling malicious data can execute code. An attacker publishes a model repository whose weights file carries a payload. The victim only has to point vLLM at it.

The attacker needs the victim to load their model, or to be able to supply the model name or path, which is why the vector marks user interaction and high complexity. The result is code execution with the rights of the vLLM process: the GPU host, its credentials, other models and cloud tokens.

The advisory notes that most models now use safetensors, which is not vulnerable. Risk is highest where teams try third-party or community checkpoints, or where users can choose which model gets loaded.

Who is affected

vllm (pip) before 0.7.0, when loading models whose weights are in pickle-based PyTorch format (.bin or .pt) from a source you do not control. Check your version:

pip show vllm

Check the weight files of the models you load: .safetensors files are not exposed to this flaw.

vllm

Ecosystem
PyPI
Affected
< 0.7.0
Fixed in
0.7.0
Check
pip show vllm

How to fix it

Upgrade to vllm 0.7.0:

pip install --upgrade "vllm>=0.7.0"

The fix is pull request 12366 (commit d3d6bb13). Besides upgrading, load only models from sources you trust, and prefer safetensors checkpoints. The advisory gives no other workaround.

How to tell if you were hit

List the models your servers have downloaded and check which have .bin or .pt weight files rather than .safetensors. Review the Hugging Face cache for repositories you did not intend to load. On the host, look at child processes launched by the vLLM process, new files, and unexpected outbound connections around model load time.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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

  • https://pytorch.org/docs/stable/generated/torch.load.html
  • Fix: https://github.com/vllm-project/vllm/pull/12366

Credited to DogeWatch, russellb.

Questions

Are safetensors models affected by CVE-2025-24357?

No. The advisory says most models use safetensors, which is not vulnerable. The risk comes from pickle-based checkpoints loaded with torch.load.

What fixes it?

vLLM 0.7.0, which includes pull request 12366.

Does the attacker need access to my server?

No, but they need you to load their model. Publishing a malicious repository and getting it loaded is enough.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More vLLM vulnerabilities

All vLLM entries