CVEfocus › CVE database › CVE-2026-31221

CVE-2026-31221

CVSS 8.8 HighEPSS 0.6% (higher than 40% of CVEs)Published 2026-05-12Updated 2026-05-15Assigner: mitre

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 objects via the Pickle module. A remote attacker can exploit this by providing a maliciously crafted checkpoint file, leading to arbitrary code execution on the victim's system when the file is loaded.

CWE-502

What to do

PyPI, Ubuntu have not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

3Fix pending
2Under investigation
1Will not fix

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10pytorchFix pendingUBUNTU-CVE-2026-31221
Ubuntu 26.04pytorchUnder investigationUBUNTU-CVE-2026-31221
Ubuntu 25.10pytorchWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2026-31221
Ubuntu 22.04pytorchUnder investigationUBUNTU-CVE-2026-31221
PyPI librarylightningFix pendingPYSEC-2026-3972
PyPI librarypytorch-lightningFix pendingPYSEC-2026-3043

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.