CVE-2026-58659
JSON

8.4high

PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter

Severity
8.4high CVSS:4.0 by VulnCheck
Exploit likelihood
0.33% (higher than 27% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-qqmf-gpg7-g8gwPYSEC-2026-3624PYSEC-2026-3967

Description

PyTorch Lightning through 2.6.5, fixed in commit d710d68, contains a remote code execution vulnerability in the _load_state function that imports and executes attacker-controlled module names from checkpoint _instantiator hyperparameters. Attackers can craft malicious checkpoint files that bypass weights_only=True protections to execute arbitrary code when LightningModule.load_from_checkpoint is called.

Affected

Product or packageVersionsReported by
Lightning-AI pytorch-lightningup to 2.6.5
Not affected: d710d689510d50e800f53b3cd773cbca20b1f86f
CVE List
lightning (PyPI)before 2.6.6GitHub Advisory Database, PyPA Advisory Database
lightningai pytorch_lightningup to 2.6.5NVD
pytorch-lightning (PyPI)before 2.6.6PyPA Advisory Database

All scores

VulnCheck8.4high CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
VulnCheck7.8high CVSS:3.1CVSS:3.1/AV:L/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
GitHubhigh CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
PyPA Advisory DatabaseNot scored CVSS:4.0CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

Classification

CWE-470

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

PyTorch Lightning through 2.6.5, fixed in commit d710d68, contains a remote code execution vulnerability in the _load_state function that imports and executes attacker-controlled module names from checkpoint _instantiator hyperparameters. Attackers can craft malicious checkpoint files that bypass weights_only=True protections to execute arbitrary code when LightningModule.load_from_checkpoint is called.

NVD (es)

PyTorch Lightning hasta la versión 2.6.5, corregido en el commit d710d68, contiene una vulnerabilidad de ejecución remota de código en la función _load_state que importa y ejecuta nombres de módulos controlados por el atacante desde los hiperparámetros _instantiator del punto de control. Los atacantes pueden crear archivos de punto de control maliciosos que eluden las protecciones de weights_only=True para ejecutar código arbitrario cuando se llama a LightningModule.load_from_checkpoint.

References

https://github.com/Lightning-AI/pytorch-lightning/issues/21822exploit, issue-tracking, mitigation, report, technical-description, web
https://github.com/Lightning-AI/pytorch-lightning/pull/21832fix, issue-tracking, patch, web
https://github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86ffix, patch, web
https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameterexploit, fix, patch, third-party-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2026-58659advisory
https://github.com/Lightning-AI/pytorch-lightningpackage
https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.6.6web
https://github.com/advisories/GHSA-qqmf-gpg7-g8gwadvisory
https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-3624.yamlweb
https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3967.yamlweb

Sources

SourceRecordLicence
CVE ListCVE-2026-58659 changed 2026-11-08CVE Terms of Use
GitHub Advisory DatabaseGHSA-qqmf-gpg7-g8gw changed 2026-09-24CC-BY-4.0
NVDCVE-2026-58659 changed 2026-10-24Public domain
PyPA Advisory DatabasePYSEC-2026-3624 changed 2026-09-10CC-BY-4.0
PyPA Advisory DatabasePYSEC-2026-3967 changed 2026-09-10CC-BY-4.0