8.8high
PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization
- Severity
- 8.8high CVSS:3.1 by CISA-ADP
- Exploit likelihood
- 0.33% (higher than 27% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-75m9-98v2-hjpmPYSEC-2026-3043PYSEC-2026-3972
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
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| pytorch-lightning (PyPI) | up to 2.6.0 | GitHub Advisory Database, PyPA Advisory Database |
| lightningai pytorch_lightning | up to 2.6.0 | NVD |
| lightning (PyPI) | up to 2.6.0 | PyPA Advisory Database |
All scores
| CISA-ADP | 8.8high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| GitHub | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
Las versiones 2.6.0 y anteriores de PyTorch-Lightning contienen una vulnerabilidad de deserialización insegura (CWE-502) en el mecanismo de carga de puntos de control. El método LightningModule.load_from_checkpoint(), que se usa comúnmente para cargar estados de modelos guardados, llama internamente a torch.load() sin establecer el parámetro de restricción de seguridad weights_only=True. Este comportamiento predeterminado permite la deserialización de objetos Python arbitrarios a través del módulo Pickle. Un atacante remoto puede explotar esto al proporcionar un archivo de punto de control creado maliciosamente, lo que lleva a la ejecución de código arbitrario en el sistema de la víctima cuando se carga el archivo.
References
| https://github.com/Lightning-AI/pytorch-lightning | package, product | |
| 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 | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-31221 changed 2026-05-15 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-75m9-98v2-hjpm changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-31221 changed 2026-11-08 | Public domain |
| PyPA Advisory Database | PYSEC-2026-3043 changed 2026-09-10 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-3972 changed 2026-09-10 | CC-BY-4.0 |