High severity · published May 12, 2026
CVE-2026-31221
PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism
7.8
CVSS
0.4%
EPSS
No
On KEV
Description
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.
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Attack vector
Local
Complexity
Low
Privileges
None
User interaction
Required
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)0.4% · higher than 32% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
PL
Pytorch Lightning · Lightningai
through 2.6.0 · source: NVD
Affected product
PL
Pytorch Lightning
Lightningai
More from Pytorch Lightning
9.8
CVE-2026-44484
Compromise of PyTorch Lightning PyPi Package Versions
9.8
CVE-2024-5980
Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning
9.8
CVE-2024-5452
RCE via Property/Class Pollution in lightning-ai/pytorch-lightning
9.8
CVE-2022-0845
Code Injection in GitHub repository pytorchlightning/pytorch-lightning prior to 1.6.0
9.1
CVE-2024-8019
Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning