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

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. ![image](https://github.com/user-attachments/assets/fdaa8520-d66a-473a-ab1f-163d793de298) 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 (542 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, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: pypi (1).

PackageEcosystemAffectedFixed In
torch
pypi
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. 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

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

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

Related CVEs

  • CVE-2026-61447
    CRITICAL

    PraisonAI: CodeAgent Executes LLM-Generated Code Without Sandboxing and Leaks All Environment Secrets

  • CVE-2026-61445
    CRITICAL

    PraisonAI: AICoder Arbitrary File Write and Command Execution via LLM Tool Calls

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies