CVE-2026-31221
HIGH 7.8CVSS 3.1PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization
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.
- Published
- 12 May 2026
- Last modified
- 8 Nov 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-502
- Also known as
- GHSA-75m9-98v2-hjpmPYSEC-2026-3043PYSEC-2026-3972
- Sources
- NVDJSONOSV GHSA-75m9-98v2-hjpmJSONOSV PYSEC-2026-3043JSONOSV PYSEC-2026-3972JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| NVD | 134c704f-9b21-4f2e-91b3-4a467353bcc0 (Secondary) | CVSS 3.1 | HIGH 8.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | nvd@nist.gov (Primary) | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | GitHub | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| OSV | PyPA | CVSS 3.1 | HIGH 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | lightningai | pytorch_lightningcpe:2.3:a:lightningai:pytorch_lightning:*:*:*:*:*:python:*:* |
<= 2.6.0 | |
| OSV | PyPI | pytorch-lightning | <= 2.6.0 | |
| OSV | PyPI | lightning | <= 2.6.0 |
References
- https://github.com/Lightning-AI/pytorch-lightning · Product, PACKAGE
- https://www.notion.so/CVE-2026-31221-35d1e1393188815f8db7c4fd08076639 · Exploit, Third Party Advisory, WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-31221 · ADVISORY
- https://pypi.org/project/pytorch-lightning · PACKAGE
- https://github.com/advisories/GHSA-75m9-98v2-hjpm · ADVISORY
History
- 25 Nov 2026 21:02 UTC · NVD: first stored (published 12 May 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 10 Sep 2026)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 13 Jul 2026)
- 25 Nov 2026 20:11 UTC · OSV: first stored (published 12 May 2026)