Skip to content
Submit incident
AII-1001-90219
ConfirmedA court, a regulator or the organization itself has stated the core facts, or the record cites a court or regulator source.

PyTorch torch.load remote code execution vulnerability with weights_only=True

A remote code execution vulnerability was discovered in PyTorch's torch.load function when used with the weights_only=True parameter, which had been documented as a secure way to load model weights. The vulnerability affects versions up to 2.5.1 and was patched in version 2.6.0.

17 April 2025 Β· PyTorch Β· Security and cyberattacks
17 April 2025
AII-1001-902192 sources ↓
Quick facts
Organization
PyTorch (subject)
Category
Security and cyberattacks
Source
github.com
Date
17 April 2025
Drafted by
Raidu Incident Detection

What happened

A remote code execution (RCE) vulnerability was identified in PyTorch's torch.load function when called with weights_only=True. PyTorch documentation had considered this parameter setting to be safe for loading model weights, contrasting with the unsafe weights_only=False setting.

Reported impact

The vulnerability affects PyTorch versions up to 2.5.1 and allows remote code execution despite the weights_only=True security parameter being enabled.

Index analysis

The vulnerability undermines PyTorch's documented security recommendation that using torch.load with weights_only=True mitigates security issues commonly associated with loading untrusted model files.

Classification

Organization
PyTorch (subject)
Category
Security and cyberattacks
Harm status
Potential harm
Intent
Unknown
Timing
Unknown
AI systems
PyTorch

Sources and evidence

This record was researched and written by the Index, based on the following original reporting.

github.com
https://github.com/pytorch/pytorch/security/advisories/GHSA-53q9-r3pm-6pq6
cve.org
NVD entry