PyTorch-Lightning Insecure Deserialization Vulnerability Allowing Arbitrary Code Execution

Vulnerability

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.

Impact

Exploitation of this vulnerability allows for arbitrary code execution on the system where the vulnerable version of PyTorch-Lightning is used.

Reproduction

To reproduce this vulnerability, load a maliciously crafted checkpoint file into a PyTorch-Lightning model using the load_from_checkpoint() method. The checkpoint file must be designed to execute arbitrary code upon deserialization.

Remediation

Users can update to PyTorch-Lightning versions later than 2.6.0, where this vulnerability has been addressed.

Added: May 12, 2026, 4:26 PM
Updated: May 12, 2026, 4:26 PM

Vulnerability Rating

Custom Algorithm
spread
5.4
impact
7.5
exploitability
4.7
remediation
7.7
relevance
8.1
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.