CVE-2026-58659
Received Received - Intake

PyTorch Lightning Remote Code Execution via Checkpoint

Vulnerability report for CVE-2026-58659, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-15

Last updated on: 2026-07-15

Assigner: VulnCheck

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.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-15
Last Modified
2026-07-15
Generated
2026-07-15
AI Q&A
2026-07-15
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
lightning-ai pytorch_lightning to 2.6.5 (inc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-470 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.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability in PyTorch Lightning (CVE-2026-58659) allows arbitrary code execution through malicious checkpoint files. The issue is in the _load_state function which imports and executes attacker-controlled module names from the _instantiator hyperparameter in checkpoints. Even with weights_only=True protections enabled, attackers can bypass these safeguards to run arbitrary code when LightningModule.load_from_checkpoint is called.

The vulnerability exists because the _instantiator parameter is processed before validation, allowing dynamic imports of untrusted code. The fix restricts _instantiator resolution to a predefined allowlist of trusted instantiators.

Impact Analysis

If you use PyTorch Lightning versions up to 2.6.5, an attacker could craft a malicious checkpoint file that executes arbitrary code on your system when you load the file using load_from_checkpoint. This could lead to data theft, system compromise, or further network infiltration depending on your environment.

Compliance Impact

This vulnerability could lead to unauthorized data access or exfiltration, violating GDPR's data protection requirements and HIPAA's security rules for protected health information. Organizations using affected PyTorch Lightning versions may face compliance violations if exploited.

Detection Guidance

To detect this vulnerability, inspect PyTorch Lightning versions. Run: pip show pytorch-lightning. If version <=2.6.5, it is vulnerable. Check for malicious checkpoint files by examining _instantiator hyperparameters in .ckpt files using a text editor or hex editor.

Mitigation Strategies

Upgrade PyTorch Lightning to a version beyond 2.6.5. Avoid loading untrusted checkpoint files. If loading is necessary, validate _instantiator values against a trusted allowlist. Disable dynamic imports from checkpoint hyperparameters.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-58659. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart