CVE-2026-31221 Details
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.
A vulnerability allowing insecure deserialization has been identified in PyTorch-Lightning versions through 2.6.0. This issue arises in the checkpoint loading process, specifically within the LightningModule.load_from_checkpoint() method. The method calls torch.load() without the security-focused weights_only=True parameter, enabling the deserialization of arbitrary Python objects using the Pickle module. As a result, a remote attacker could exploit this vulnerability by supplying a maliciously crafted checkpoint file, leading to arbitrary code execution on the victim's system when the file is loaded.
Users can update to PyTorch-Lightning versions later than 2.6.0, where this vulnerability has been addressed.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed May 15, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/Lightning-AI/pytorch-lightning | [email protected] | Product |
| https://www.notion.so/CVE-2026-31221-35d1e1393188815f8db7c4fd08076639 | [email protected] | ExploitThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-502 | Deserialization of Untrusted Data | [email protected] |
| CWE-502 | Deserialization of Untrusted Data | CISA-ADP |
Affected Products
| Product | Versions |
|---|---|
| lightningai pytorch lightning | <= 2.6.0 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| May 15, 2026 | CVE Modified | CISA-ADP |
| May 14, 2026 | Initial Analysis | [email protected] |
| May 12, 2026 | New CVE Received | [email protected] |