CVE-2026-58659 Details
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.
A remote code execution vulnerability has been identified in PyTorch Lightning versions through 2.6.5. The issue arises in the '_load_state' function, where the '_instantiator' hyperparameter from checkpoint files is imported and executed. This vulnerability allows attackers to craft malicious checkpoint files that bypass the 'weights_only=True' protection, executing arbitrary code when 'LightningModule.load_from_checkpoint' is called.
Users can update to PyTorch Lightning version 2.6.6 or later, where this vulnerability has been fixed. Instructions for updating can be found in the PyTorch Lightning documentation.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 18, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86f | [email protected] | Patch |
| https://github.com/Lightning-AI/pytorch-lightning/issues/21822 | [email protected] | ExploitIssue TrackingMitigation |
| https://github.com/Lightning-AI/pytorch-lightning/pull/21832 | [email protected] | Issue TrackingPatch |
| https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter | [email protected] | ExploitPatchThird Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-470 | Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| lightningai pytorch lightning | <= 2.6.5 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 6, 2026 | Initial Analysis | [email protected] |
| Jul 18, 2026 | CVE Modified | CISA-ADP |
| Jul 15, 2026 | New CVE Received | [email protected] |