Loading advisory.
Loading advisory.
PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
I found a Remote Command Execution (RCE) vulnerability in PyTorch. When loading model using torch.load with weights_only=True, it can still achieve RCE.
Published 2025-04-18 15:19 UTC · Modified 2026-08-07 08:12 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score. How tiers work
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| torch | PyPI | < 2.6.0 versions 1.0.0, 1.0.1, 1.1.0, 1.10.0, 1.10.1, 1.10.2, 1.11.0, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.2.0, 1.3.0, 1.3.1, 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1 and 18 more | 2.6.0 | pip install --upgrade 'torch>=2.6.0' |
I found a Remote Command Execution (RCE) vulnerability in PyTorch. When loading model using torch.load with weights_only=True, it can still achieve RCE.
https://github.com/pytorch/pytorch/security
As you can see, the PyTorch official documentation considers using torch.load() with weights_only=True to be safe.
image
Since everyone knows that weights_only=False is unsafe, so they will use the weights_only=True to mitigate the seucirty issue.
But now, I just proved that even if you use weights_only=True, it can still achieve RCE.
This vulnerability was found by Ji'an Zhou.
Exploit code or a detection template for this CVE is published by the sources below. This is not a report of use against real systems (that is what CISA KEV records) and it does not change the tier.
EPSS went from 0.024 on 2026-11-24 to 0.026 on 2026-11-26, over 2 recorded scores.
| Date | Score | Previous | Model |
|---|---|---|---|
| 2026-11-24 | 0.024 | first score | v2026.06.15 |
| 2026-11-26 | 0.026 | 0.024 | v2026.06.15 |