Skip to main content

CVE-2025-32434 — Vulnerability in torch — CVE Details

CRITICAL

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

Published April 18, 2025Updated August 7, 2026Source: OSV

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.

Check my requirements.txt

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
Update torch to 2.6.0 or later
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).

PackageFixed 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-502
    Deserialization of Untrusted DataMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
—
Confidentiality
—
Integrity
—
Availability
—

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

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

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
2.63%
EPSS percentile: 86.2

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

GHSA-53q9-r3pm-6pq6
BIT-pytorch-2025-32434
PYSEC-2025-41

Related CVEs

  • CVE-2026-77359
    CRITICAL

    Jupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routes

  • CVE-2026-77312
    CRITICAL

    Flyto2 Core: Arbitrary file write via unguarded data.*/file.* modules (incomplete fix of CVE-2026-67429)

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my requirements.txt