CVE-2026-31221
JSON

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 packageVersionsReported by
Unspecified productn/aCVE List
pytorch-lightning (PyPI)up to 2.6.0GitHub Advisory Database, PyPA Advisory Database
lightningai pytorch_lightningup to 2.6.0NVD
lightning (PyPI)up to 2.6.0PyPA Advisory Database

All scores

CISA-ADP8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
PyPA Advisory Database7.8high CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-502

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

Sources

SourceRecordLicence
CVE ListCVE-2026-31221 changed 2026-05-15CVE Terms of Use
GitHub Advisory DatabaseGHSA-75m9-98v2-hjpm changed 2026-09-10CC-BY-4.0
NVDCVE-2026-31221 changed 2026-11-08Public domain
PyPA Advisory DatabasePYSEC-2026-3043 changed 2026-09-10CC-BY-4.0
PyPA Advisory DatabasePYSEC-2026-3972 changed 2026-09-10CC-BY-4.0