CVE-2025-32434
JSON

9.3critical

PyTorch: `torch.load` with `weights_only=True` leads to remote code execution

Severity
9.3critical CVSS:4.0 by GitHub_M
Exploit likelihood
2.37% (higher than 84% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-53q9-r3pm-6pq6BIT-PYTORCH-2025-32434PYSEC-2025-41

Description

PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built on a tape-based autograd system. In version 2.5.1 and prior, a Remote Command Execution (RCE) vulnerability exists in PyTorch when loading a model using torch.load with weights_only=True. This issue has been patched in version 2.6.0.

Affected

Product or packageVersionsReported by
pytorch pytorch< 2.6.0CVE List
torch (PyPI)before 2.6.0GitHub Advisory Database, PyPA Advisory Database
linuxfoundation pytorchbefore 2.6.0NVD
pytorch (Bitnami)before 2.6.0Bitnami Vulnerability Database

All scores

GitHub_M9.3critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
NVD9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
PyPA Advisory Database9.8critical CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Bitnami Vulnerability Databasecritical rating

Classification

CWE-502

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact total.

What each source says

CVE List

PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built on a tape-based autograd system. In version 2.5.1 and prior, a Remote Command Execution (RCE) vulnerability exists in PyTorch when loading a model using torch.load with weights_only=True. This issue has been patched in version 2.6.0.

GitHub Advisory Database

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. 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.

Credit

This vulnerability was found by Ji'an Zhou.

NVD (es)

PyTorch es un paquete de Python que proporciona computación tensorial con una potente aceleración de GPU y redes neuronales profundas basadas en un sistema de autogradación basado en cinta. En la versión 2.5.1 y anteriores, existía una vulnerabilidad de ejecución remota de comandos (RCE) en PyTorch al cargar un modelo usando torch.load con weights_only=True. Este problema se ha corregido en la versión 2.6.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-32434 changed 2025-12-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-53q9-r3pm-6pq6 changed 2026-08-07CC-BY-4.0
NVDCVE-2025-32434 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2025-41 changed 2025-05-28CC-BY-4.0
Bitnami Vulnerability DatabaseBIT-PYTORCH-2025-32434 changed 2026-09-08Apache-2.0