CVE-2026-31221

Insecure Deserialization in PyTorch-Lightning Leads to Remote Code Execution

Published May 12, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
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.

Remediation

No solution or workaround provided in the CVE record

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-75m9-98v2-hjpm PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization
History
Type Values Removed Values Added
Title Insecure Deserialization in PyTorch-Lightning Leads to Remote Code Execution
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Title Insecure Deserialization in PyTorch-Lightning Allows Arbitrary Code Execution
Type Values Removed Values Added
Weaknesses CWE-502
CPEs cpe:2.3:a:lightningai:pytorch_lightning:*:*:*:*:*:python:*:*
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Lightningai
Lightningai pytorch Lightning
Vendors & Products Lightningai
Lightningai pytorch Lightning
Type Values Removed Values Added
Title Insecure Deserialization in PyTorch-Lightning Allows Arbitrary Code Execution
Type Values Removed Values Added
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.
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
May 15, 2026, 6:05 PM
Reserved
Mar 9, 2026, 12:00 AM
Status
Modified
Published
May 12, 2026, 4:16 PM
Modified
Nov 8, 2026, 4:10 PM