cve.bz

CVE-2026-31221

7.8 highEPSS 0.4%

High (7.8) in lightningai pytorch lightning. EPSS 0.4% chance of exploitation in the next 30 days.

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.

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.4% chance of exploitation in the next 30 days; higher than 32% of CVEs (scores of 2026-10-31)
CWE
CWE-502
Published
Modified
Record from
the NVD, synced

Affected

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-75m9-98v2-hjpmPyPIpytorch-lightning<=2.6.0no fix published
PYSEC-2026-3043PyPIpytorch-lightning<=2.6.0no fix published
PYSEC-2026-3972PyPIlightning<=2.6.0no fix published

References

Check your stackJSON