CVE-2026-31221
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.
Weakness
- CWE-502: Deserialization of Untrusted Data
CISA SSVC decision points
| Exploitation | none |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2026-05-15 |
Timeline
- 2026-05-12Published by the CNA00:00 UTC
- 2026-05-12GitHub advisory published (GHSA-75m9-98v2-hjpm)same day
- 2026-05-15CISA SSVC decision recorded3 days after publication
Exploit and advisory records
GitHub advisory GHSA-75m9-98v2-hjpm, affected packages:
| Package | Vulnerable versions | Fixed in |
|---|---|---|
| PyPI pytorch-lightning | through 2.6.0 |
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| lightningai pytorch_lightning | through 2.6.0no fix listed | not listed |
References
- https://www.notion.so/CVE-2026-31221-35d1e1393188815f8db7c4fd08076639
- https://github.com/Lightning-AI/pytorch-lightning
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2026-31221'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2026-31221'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2026-31221'curl 'https://api.contrastcyber.com/cve_products/CVE-2026-31221'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).