# CVE-2026-31221: PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization

- Severity: High 8.8 (CVSS:3.1, scored by CISA-ADP) `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.33%, higher than 27% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-05-12T00:00:00.000Z
- Modified: 2026-11-08T16:10:00.183Z
- Also known as: GHSA-75m9-98v2-hjpm, PYSEC-2026-3043, PYSEC-2026-3972
- Weaknesses: CWE-502
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: mitre

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

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- pytorch-lightning (PyPI): up to 2.6.0
- lightningai pytorch_lightning: up to 2.6.0
- lightning (PyPI): up to 2.6.0

## Every score

- CISA-ADP: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://www.notion.so/CVE-2026-31221-35d1e1393188815f8db7c4fd08076639> (exploit, third-party-advisory, web)
- <https://github.com/Lightning-AI/pytorch-lightning> (package, product)
- <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)

## Sources

- CVE List: [CVE-2026-31221](https://www.cve.org/CVERecord?id=CVE-2026-31221), CVE Terms of Use, modified 2026-05-15
- GitHub Advisory Database: [GHSA-75m9-98v2-hjpm](https://github.com/advisories/GHSA-75m9-98v2-hjpm), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-31221](https://nvd.nist.gov/vuln/detail/CVE-2026-31221), Public domain, modified 2026-11-08
- PyPA Advisory Database: [PYSEC-2026-3043](https://osv.dev/vulnerability/PYSEC-2026-3043), CC-BY-4.0, modified 2026-09-10
- PyPA Advisory Database: [PYSEC-2026-3972](https://osv.dev/vulnerability/PYSEC-2026-3972), CC-BY-4.0, modified 2026-09-10

---

Page: https://cve.day/CVE-2026-31221 · Whole record: https://cve.day/CVE-2026-31221.json · Rebuilt by cve.day 2026-11-25T22:59:21.367Z
