Back to list

PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization — CVE-2026-31221

GitHub · GitHub · CVE-2026-31221

ID
CVE-2026-31221
Date
Updated
Activity
Source
GitHub
Vendor
GitHub
Threat
high
CVSS
7.8
EPSS
0.00191

Summary

PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism. The LightningModule.load_from_checkpoint() method, which is commonly used to load saved model states, internally calls torch.load() without setting the security-restrictive weights_only=True parameter. This default behavior allows the deserialization of arbitrary Python…

Product

pip: pytorch-lightning

What to do

General, cautious steps (verify details in the official source):

  • Prioritize patching or mitigation immediately (treat as actively risky).
  • Identify affected product versions in your inventory and verify whether you are impacted.
  • Apply vendor patches/updates or recommended mitigations as soon as available.
  • Read the official advisory for exact affected versions and remediation steps.

Official advisory

Related advisories