Deserialization in Lightningai Pytorch Lightning

CVE-2026-31221

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.

Vulnerability class: Insecure Deserialization

Published · last modified .

CVSS v3 metric

CVSS v3 base score 7.8 (High). Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

EPSS exploit prediction

EPSS: 0.006 (44.0th percentile), scored .

Very low probability of exploitation in the next 30 days; routine patching cadence is appropriate. 44th percentile — 44.0% of CVEs in the catalogue have a lower EPSS than this one. How to read EPSS.

EPSS trend (30 days)EPSS over the last 30 days for CVE-2026-31221: held from 0.004 to 0.006.

EPSS over last 30 days · oldest: 0.004 · newest: 0.006 · change: +0.002

Affected products

Weakness classification (CWE)

References

Frequently asked questions

What is CVE-2026-31221?
CVE-2026-31221 is a high-severity vulnerability in Lightningai Pytorch Lightning, classified under Deserialization of Untrusted Data. CVSS score: 7.8/10. Published 2026-05-12.
How severe is CVE-2026-31221?
High severity. CVSS v3 base score is 7.8 out of 10.