Vulnerability · Published Jul 15, 2026 · Assigned by VulnCheck
CVE-2026-58659PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter
High 7.8
In plain English
A high-severity security flaw in pytorch-lightning from Lightning-AI. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 50% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| PyPI | lightning | 2.6.6 | GHSA-qqmf-gpg7-g8gw |
| PyPI | lightning | 2.6.6 | PYSEC-2026-3624 |
| PyPI | pytorch-lightning | 2.6.6 | PYSEC-2026-3967 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Lightning-AI | pytorch-lightning | 0 – through 2.6.5 |
Weakness: CWE-470 · Vector: CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- Researcher Disclosure technical-description, exploit
- Pull Request issue-tracking
- Patch Commit patch
- https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter third-party-advisory