CVE-2025-32434
PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
Auswirkung
# Description 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. # Background knowledge 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.  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. # Credit This vulnerability was found by Ji'an Zhou.
Ein Angreifer kann die Lücke über das Netzwerk ausnutzen, ohne Anmeldung, ohne Zutun eines Nutzers. Bei Erfolg: hohes Risiko, dass Daten ausgelesen werden, hohes Risiko, dass Daten oder Systeme verändert werden, hohes Risiko für Ausfälle.
Betroffene Pakete
| Ökosystem | Paket | Betroffen | Behoben in |
|---|---|---|---|
| pip | torch | < 2.6.0 | 2.6.0 |
Betroffene Produkte · Linuxfoundation
| Produkt | Betroffene Versionen |
|---|---|
| Pytorch | vor 2.6.0 |
Schwachstellenklasse
Referenzen
- NVD-Eintrag
- CVE.org-Eintrag
- GitHub-Advisory
- https://github.com/pytorch/pytorch/security/advisories/GHSA-53q9-r3pm-6pq6
- https://lists.debian.org/debian-lts-announce/2025/12/msg00000.html
- https://github.com/advisories/GHSA-53q9-r3pm-6pq6
- https://github.com/pytorch/pytorch/commit/8d4b8a920a2172523deb95bf20e8e52d50649c04
- https://nvd.nist.gov/vuln/detail/CVE-2025-32434
- https://github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2025-41.yaml