CVE-2026-24747
📋 TL;DR
A vulnerability in PyTorch's `weights_only` unpickler allows attackers to craft malicious checkpoint files (.pth) that, when loaded, can corrupt memory and potentially lead to arbitrary code execution. This affects all PyTorch users who load untrusted checkpoint files with `torch.load(..., weights_only=True)`. The vulnerability is fixed in version 2.10.0.
💻 Affected Systems
- PyTorch
📦 What is this software?
Pytorch by Linuxfoundation
⚠️ Risk & Real-World Impact
Worst Case
Arbitrary code execution with the privileges of the PyTorch process, potentially leading to full system compromise.
Likely Case
Memory corruption leading to application crashes, denial of service, or limited code execution depending on exploit sophistication.
If Mitigated
No impact if only trusted checkpoint files are loaded or if the system is patched.
🎯 Exploit Status
Exploitation requires the victim to load a malicious checkpoint file. No public exploit code has been disclosed as of the advisory.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2.10.0
Vendor Advisory: https://github.com/pytorch/pytorch/security/advisories/GHSA-63cw-57p8-fm3p
Restart Required: No
Instructions:
1. Upgrade PyTorch to version 2.10.0 or later using pip: `pip install --upgrade torch==2.10.0`. 2. Verify the upgrade completed successfully. 3. No restart is required for Python processes, but applications using PyTorch should be reloaded.
🔧 Temporary Workarounds
Avoid loading untrusted checkpoint files
allDo not load PyTorch checkpoint files from untrusted sources with `torch.load(..., weights_only=True)`.
Use pickle with caution
allIf `weights_only=True` cannot be avoided, consider additional validation of checkpoint files before loading.
🧯 If You Can't Patch
- Implement strict access controls to prevent loading of untrusted checkpoint files.
- Monitor for abnormal application behavior or crashes when loading checkpoint files.
🔍 How to Verify
Check if Vulnerable:
Check PyTorch version: if below 2.10.0 and using `torch.load(..., weights_only=True)` with untrusted files, the system is vulnerable.
Check Version:
python -c "import torch; print(torch.__version__)"
Verify Fix Applied:
Verify PyTorch version is 2.10.0 or higher and test loading known safe checkpoint files with `weights_only=True` to ensure functionality.
📡 Detection & Monitoring
Log Indicators:
- Application crashes or errors when loading PyTorch checkpoint files
- Unusual memory usage patterns in PyTorch processes
Network Indicators:
- Downloads of PyTorch checkpoint files from untrusted sources
SIEM Query:
Search for process executions of Python scripts loading .pth files with torch.load and errors/crashes following those events.