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...
Full CISO analysis pending enrichment.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| PyTorch Lightning | pip | < 2022.6.15 | 2022.6.15 |
| PyTorch Lightning | pip | — | No patch |
How severe is it?
What is the attack surface?
What should I do?
Patch available
Update PyTorch Lightning to version 2022.6.15
Which compliance frameworks are affected?
Compliance analysis pending. Sign in for full compliance mapping when available.
Frequently Asked Questions
What is CVE-2026-58659?
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.
Is CVE-2026-58659 actively exploited?
No confirmed active exploitation of CVE-2026-58659 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-58659?
Update to patched version: PyTorch Lightning 2022.6.15.
What is the CVSS score for CVE-2026-58659?
CVE-2026-58659 has a CVSS v3.1 base score of 7.8 (HIGH). The EPSS exploitation probability is 0.33%.
What are the technical details?
Original Advisory
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.
Weaknesses (CWE)
CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Primary
CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')
Primary
CWE-470 Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') CWE-470 — Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection'): The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.
- [Architecture and Design] Refactor your code to avoid using reflection.
- [Architecture and Design] Do not use user-controlled inputs to select and load classes or code.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H References
- github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86f patch
- github.com/Lightning-AI/pytorch-lightning/issues/21822 technical-description exploit
- github.com/Lightning-AI/pytorch-lightning/pull/21832 issue-tracking
- vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter third-party-advisory
- github.com/advisories/GHSA-qqmf-gpg7-g8gw
- github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-3624.yaml
- nvd.nist.gov/vuln/detail/CVE-2026-58659
Timeline
Related Vulnerabilities
CVE-2022-0845 9.8 pytorch-lightning: code injection enables full RCE
Same package: pytorch-lightning CVE-2024-5452 9.8 pytorch-lightning: RCE via deepdiff Delta deserialization
Same package: pytorch-lightning CVE-2024-8019 9.1 pytorch-lightning: file upload RCE (Windows)
Same package: pytorch-lightning CVE-2026-24747 8.8 pytorch: Code Injection enables RCE
Same package: pytorch-lightning CVE-2026-31221 7.8 pytorch-lightning: RCE via insecure checkpoint deserialization
Same package: pytorch-lightning