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).
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | lightning | no fix listed | PYSEC-2026-3972 |
| PyPI | pytorch-lightning | no fix listed | GHSA-75m9-98v2-hjpm |
| PyPI | pytorch-lightning | no fix listed | PYSEC-2026-3043 |
| Ubuntu:22.04:LTS | pytorch | no fix listed | UBUNTU-CVE-2026-31221 |
| Ubuntu:25.10 | pytorch | no fix listed | UBUNTU-CVE-2026-31221 |
| Ubuntu:26.04:LTS | pytorch | no fix listed | UBUNTU-CVE-2026-31221 |
| Ubuntu:26.10 | pytorch | no fix listed | UBUNTU-CVE-2026-31221 |
Affected products (as reported)
Weakness: CWE-502 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H