CVE-2026-58659 — lightning
Fix: Lightning-AI/pytorch-lightning@d710d68CVE-2026-58659 is a CWE-470 vulnerability in lightning. A fix is available for lightning — see the affected versions and patch details below.
PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-58659.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
lightningReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | lightning | all versions | 2.6.6pip install --upgrade 'lightning==2.6.6' |
Affected Products
pytorch lightninglightningaiDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for lightning, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update lightning to 2.6.6 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-58659 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This is an Important severity flaw in PyTorch Lightning that could lead to remote code execution. The vulnerability arises from the _load_state function's ability to import and execute attacker-controlled module names from maliciously crafted checkpoint files, even when weights_only=True is enabled. Exploitation…
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat AI Inference Server 3.3 | rhaiis/vllm-rocm-rhel9:1789504371 | RHSA-2026:68698 |
| Red Hat AI Inference Server 3.3 | rhaiis/vllm-cuda-rhel9:1789582776 | RHSA-2026:68699 |
| Red Hat AI Inference Server 3.4 | rhaii/vllm-cpu-rhel9:1789681128 | RHSA-2026:69466 |
| Red Hat AI Inference Server 3.4 | rhaii/vllm-cuda-rhel9:1789681126 | RHSA-2026:69467 |
| Red Hat AI Inference Server 3.4 | rhaii/vllm-cpu-rhel9:1790075793 | RHSA-2026:70965 |
| Red Hat AI Inference Server 3.4 | rhaii/vllm-cuda-rhel9:1790090131 | RHSA-2026:70979 |
| Red Hat AI Inference Server 3.5 | rhaii/vllm-cuda-rhel9:1791473631 | RHSA-2026:82368 |
| Red Hat AI Inference Server 3.5 | rhaii/vllm-cpu-rhel9:1791473614 | RHSA-2026:82415 |
Frequently Asked Questions
Is CVE-2026-58659 in your dependencies?
Find it across PyPI, including transitive dependencies.