Vulnerability · Published May 12, 2026 · Assigned by mitre

CVE-2026-31221

High 8.8

In plain English

A high-severity unsafe deserialization in the lightning package (PyPI). There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 33% of all known vulnerabilities).

Severity (CVSS 3.1)8.8High
Exploit odds (30 days)0.4%top 67.2% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
PyPIlightningno fix listedPYSEC-2026-3972
PyPIpytorch-lightningno fix listedGHSA-75m9-98v2-hjpm
PyPIpytorch-lightningno fix listedPYSEC-2026-3043
Ubuntu:22.04:LTSpytorchno fix listedUBUNTU-CVE-2026-31221
Ubuntu:25.10pytorchno fix listedUBUNTU-CVE-2026-31221
Ubuntu:26.04:LTSpytorchno fix listedUBUNTU-CVE-2026-31221
Ubuntu:26.10pytorchno fix listedUBUNTU-CVE-2026-31221

Affected products (as reported)

VendorProductVersions
n/a n/a n/a

Weakness: CWE-502 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

References