CVE-2025-32434: PyTorch: RCE bypasses weights_only=True safe-load guard
GHSA-53q9-r3pm-6pq6 CRITICAL PoC AVAILABLE CISA: TRACK*Any system loading PyTorch models with torch.load() — even with the supposedly safe weights_only=True flag — is vulnerable to remote code execution. Upgrade to torch >= 2.6.0 immediately; this is not optional. Treat all externally-sourced model files as untrusted inputs regardless of loading parameters until patched.
Risk Assessment
CRITICAL. CVSS 9.8 with no-auth, network-reachable, zero-user-interaction attack path. The amplifying factor is deception: weights_only=True was the documented secure practice, so teams that followed security guidance are still exposed. Attack surface is enormous — model hubs, CI/CD pipelines pulling pre-trained weights, inference servers, and any MLOps workflow that loads .pt/.pth files. EPSS of 1.2% is low today but PoC development is predictable given the high-profile nature of the bypass.
Affected Systems
Severity & Risk
Attack Surface
Recommended Action
6 steps-
PATCH
Upgrade torch to >= 2.6.0 immediately (pip install --upgrade torch).
-
INVENTORY
Identify all code paths using torch.load() — grep codebase for 'torch.load'.
-
VALIDATE MODEL PROVENANCE
Implement cryptographic signing/verification of model artifacts before loading (e.g., model card checksums from official sources).
-
SANDBOX
Run model loading in isolated containers/VMs with no network egress and minimal filesystem access.
-
DETECT
Alert on unexpected network connections or subprocess spawns from model serving processes.
-
INTERIM WORKAROUND (if patching is delayed): Only load models from cryptographically verified, internal-only sources and block external model downloads at the network level.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-32434?
Any system loading PyTorch models with torch.load() — even with the supposedly safe weights_only=True flag — is vulnerable to remote code execution. Upgrade to torch >= 2.6.0 immediately; this is not optional. Treat all externally-sourced model files as untrusted inputs regardless of loading parameters until patched.
Is CVE-2025-32434 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-32434, increasing the risk of exploitation.
How to fix CVE-2025-32434?
1. PATCH: Upgrade torch to >= 2.6.0 immediately (pip install --upgrade torch). 2. INVENTORY: Identify all code paths using torch.load() — grep codebase for 'torch.load'. 3. VALIDATE MODEL PROVENANCE: Implement cryptographic signing/verification of model artifacts before loading (e.g., model card checksums from official sources). 4. SANDBOX: Run model loading in isolated containers/VMs with no network egress and minimal filesystem access. 5. DETECT: Alert on unexpected network connections or subprocess spawns from model serving processes. 6. INTERIM WORKAROUND (if patching is delayed): Only load models from cryptographically verified, internal-only sources and block external model downloads at the network level.
What systems are affected by CVE-2025-32434?
This vulnerability affects the following AI/ML architecture patterns: model serving, training pipelines, transfer learning workflows, MLOps CI/CD pipelines, model registries and hubs.
What is the CVSS score for CVE-2025-32434?
CVE-2025-32434 has a CVSS v3.1 base score of 9.8 (CRITICAL). The EPSS exploitation probability is 1.22%.
Technical Details
NVD 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.
Exploitation Scenario
Adversary publishes a malicious PyTorch model to a public hub (HuggingFace, GitHub, Kaggle) — either a novel model or a trojanized version of a popular one (BERT, Llama, ResNet). A data scientist or MLOps pipeline downloads and loads it with torch.load(model_path, weights_only=True), trusting the flag provides safety. The crafted serialization payload bypasses the weights_only restriction, executing arbitrary Python during deserialization. Adversary achieves RCE on the inference server or training node, establishes persistence, and pivots to access training data, model IP, cloud credentials, or connected infrastructure. In a model-serving context exposed via API, the attack may be remotely triggerable without requiring the victim to manually download anything.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H References
- lists.debian.org/debian-lts-announce/2025/12/msg00000.html
- github.com/advisories/GHSA-53q9-r3pm-6pq6
- github.com/pypa/advisory-database/tree/main/vulns/torch/PYSEC-2025-41.yaml
- github.com/pytorch/pytorch/commit/8d4b8a920a2172523deb95bf20e8e52d50649c04
- nvd.nist.gov/vuln/detail/CVE-2025-32434
- github.com/pytorch/pytorch/security/advisories/GHSA-53q9-r3pm-6pq6 Vendor
- github.com/2h3ph3rd/CVE-2025-32434 Exploit
- github.com/ARPSyndicate/cve-scores Exploit
- github.com/Adrasteon/JustNewsAgent Exploit
- github.com/BancaKim/CallbotPoC Exploit
- github.com/Camier/VOIXCODER Exploit
- github.com/DhwanilPanchani/SecureCode-AI---Intelligent-Vulnerability-Detection-System Exploit
- github.com/DhwanilPanchani/SecureCode-AI-based-Intelligent-Vulnerability-Detection-System Exploit
- github.com/Ka10ken1/Jobless-AI Exploit
- github.com/Ka10kenHQ/Jobless-AI Exploit
- github.com/Limbicnation/multi-vision-toolkit Exploit
- github.com/Motive-Music-AB/sibyllai-core Exploit
- github.com/PuddinCat/GithubRepoSpider Exploit
- github.com/Sir-Teo/post-training Exploit
- github.com/Zylan-cell/manga-translator-api Exploit
- github.com/asko123/dora_controls Exploit
- github.com/chesterit21/SFCore.FineTunerX.ChatGPT Exploit
- github.com/coderkhongodo/baseline_dataVN Exploit
- github.com/franzheffa/video-search-and-summarization-viize Exploit
- github.com/geekylax/transformer-model-translation Exploit
- github.com/gil-feldman-glidetalk/video-search-and-summarization Exploit
- github.com/iDhruv11/emotion-translation Exploit
- github.com/ibf-RWTH/a0-Measurements Exploit
- github.com/larryjar/RAG-LangChain-Qwen2.5-7B-Instruct-BGE-M3-Chroma- Exploit
- github.com/nomi-sec/PoC-in-GitHub Exploit
- github.com/pihu-aims/dealflow-ai Exploit
- github.com/rae2001/paperless-rag Exploit
- github.com/rmkraus/video-search-and-summarization Exploit
- github.com/seheli24/HIT137-Assignment-03-SYD06-Tkinter-HF-GUI- Exploit
- github.com/seheli24/HIT137-Tkinter-HF-GUI Exploit
- github.com/smirk-dev/VideoCraft Exploit
- github.com/smirk-dev/VideoCraft-first-iteration Exploit
- github.com/ssharmaSD/f1-rag Exploit
- github.com/tanjiti/sec_profile Exploit
- github.com/tkhahns/multimodal-data-pipeline Exploit
- github.com/wzg7014/USTB-AI Exploit
Timeline
Related Vulnerabilities
CVE-2024-5452 9.8 pytorch-lightning: RCE via deepdiff Delta deserialization
Same package: torch CVE-2023-43654 9.8 TorchServe: SSRF + RCE via unrestricted model URL loading
Same package: torch CVE-2022-45907 9.8 PyTorch: RCE via unsafe eval in JIT annotations
Same package: torch CVE-2022-0845 9.8 pytorch-lightning: code injection enables full RCE
Same package: torch CVE-2024-35198 9.8 TorchServe: URL bypass enables arbitrary model loading
Same package: torch
AI Threat Alert