CVE-2025-32434 — Vulnerability in torch — CVE Details
PyTorch: `torch.load` with `weights_only=True` leads to remote code execution
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (2.63%). Schedule for your next planned update.
Does your project use an affected torch version?
Paste your requirements.txt to check it for CVE-2025-32434 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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.
Advisory Timeline
- First published April 18, 2025 (587 days ago).
- Last revised August 7, 2026 — 476 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
pip install "torch>=2.6.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: PyPI (1).
| Package | Fixed In |
|---|---|
| torch PyPI · Affected: 1.0.0, 1.0.1, 1.1.0, 1.10.0 (+34 more) | 2.6.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-502Deserialization of Untrusted DataMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
References
- https://github.com/pytorch/pytorch/security/advisories/GHSA-53q9-r3pm-6pq6WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-32434ADVISORY
- https://github.com/pytorch/pytorch/commit/8d4b8a920a2172523deb95bf20e8e52d50649c04WEB
- https://github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2025-41.yamlWEB
- https://github.com/pytorch/pytorchPACKAGE
Frequently Asked Questions
- What is CVE-2025-32434?
- PyTorch: `torch.load` with `weights_only=True` leads to remote code execution. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
- How do I check if my project is affected by CVE-2025-32434?
- CVE-2025-32434 affects torch. It has a 2.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-32434 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Maximum impact if exploited, often with little effort or access required.
This places it in the top quartile of EPSS-scored vulnerabilities — 86.2% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-77359CRITICAL
Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes
- CVE-2026-77312CRITICAL
Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)