Incident report

PyTorch torch.load(weights_only=True) Safety Bypass Remote Code Execution

CVE-2025-32434 (CVSS 9.3, published April 18, 2025) shattered a widely relied-upon ML security assumption by bypassing `torch.load(..., weights_only=True)` in PyTorch versions `<= 2.5.1`. Security teams had adopted `weights_only=True` to safely load external `.pt` checkpoints without executing embedded Python pickle code, yet researchers found crafted TorchScript/legacy archive structures that still triggered arbitrary code execution during deserialization. Any ML pipeline loading community PyTorch checkpoints on vulnerable builds remained exposed to workstation and CI compromise. PyTorch 2.6.0 remediated the loader bypass and reinforced migration to `safetensors`.

Incident record

Reported
Severity
Critical
Vector
Supply Chain
Affected system type
Deep Learning Training & Checkpoint Loaders
Reference
CVE-2025-32434
Reference URI
https://nvd.nist.gov/vuln/detail/CVE-2025-32434

Inspect in Interactive Incidents Hub

Defensive lesson

Upgrade PyTorch to 2.6.0+, migrate model storage formats to memory-safe safetensors, and never rely solely on weights_only=True as a substitute for artifact verification.

Referenced techniques