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 package | Versions | Reported by |
|---|---|---|
| Lightning-AI pytorch-lightning | up to 2.6.5 Not affected: d710d689510d50e800f53b3cd773cbca20b1f86f | CVE List |
| lightning (PyPI) | before 2.6.6 | GitHub Advisory Database, PyPA Advisory Database |
| lightningai pytorch_lightning | up to 2.6.5 | NVD |
| pytorch-lightning (PyPI) | before 2.6.6 | PyPA Advisory Database |
All scores
| VulnCheck | 8.4high CVSS:4.0 | CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| VulnCheck | 7.8high CVSS:3.1 | CVSS:3.1/AV:L/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 |
| GitHub | high CVSS:4.0 | CVSS: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 Database | Not scored CVSS:4.0 | CVSS: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
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/21822 | exploit, issue-tracking, mitigation, report, technical-description, web | |
| https://github.com/Lightning-AI/pytorch-lightning/pull/21832 | fix, issue-tracking, patch, web | |
| https://github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86f | fix, patch, web | |
| https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter | exploit, fix, patch, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-58659 | advisory | |
| https://github.com/Lightning-AI/pytorch-lightning | package | |
| https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.6.6 | web | |
| https://github.com/advisories/GHSA-qqmf-gpg7-g8gw | advisory | |
| https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-3624.yaml | web | |
| https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3967.yaml | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-58659 changed 2026-11-08 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-qqmf-gpg7-g8gw changed 2026-09-24 | CC-BY-4.0 |
| NVD | CVE-2026-58659 changed 2026-10-24 | Public domain |
| PyPA Advisory Database | PYSEC-2026-3624 changed 2026-09-10 | CC-BY-4.0 |
| PyPA Advisory Database | PYSEC-2026-3967 changed 2026-09-10 | CC-BY-4.0 |