CVE-2026-58659

PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter

Published Jul 15, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical impact

PyTorch Lightning prior to version 2.6.5 contains a flaw in its checkpoint loading logic where attacker‑controlled module names in the _instantiator hyperparameters can be imported and executed. This defect permits the execution of arbitrary code whenever LightningModule.load_from_checkpoint is invoked, effectively allowing a malicious user to run arbitrary payloads on a system that loads the compromised checkpoint. The weakness is related to unsafe code execution and improper deserialization of untrusted data.

Affected Systems

The vulnerability affects PyTorch Lightning implementations provided by Lightning‑AI, specifically all releases up to and including 2.6.5. The fix was introduced in commit d710d68, which is included in releases beyond that point (e.g., 2.6.6 and later). No other versions or vendors are listed as affected.

Risk and Exploitability

The severity is reflected in a CVSS score of 8.4, indicating high impact if exploited. The EPSS score is below 1%, suggesting a low probability of active exploitation currently, and the issue is not catalogued in CISA’s KEV list. Attackers likely need to deliver or otherwise provide a malicious checkpoint file to a processing node that calls load_from_checkpoint; the attack could be local or remote depending on how checkpoints are sourced. Because the flaw enables arbitrary module imports, successful exploitation would give attackers full control over the executing environment.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to PyTorch Lightning 2.6.6 or later, which includes the patch that removes unsafe instantiation from checkpoints.
  • Avoid loading checkpoints from untrusted or externally provided sources when using load_from_checkpoint.
  • If a checkpoint must be loaded from a potentially untrusted source, verify or sanitize the _instantiator hyperparameters before passing them to the loader, or use an alternative method that does not process these hyperparameters.

Generated by OpenCVE AI on July 31, 2026 at 03:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-qqmf-gpg7-g8gw PyTorch Lightning allows arbitrary code execution through checkpoint _instantiator hyperparameters
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
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.
Title PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter
First Time appeared Lightningai
Lightningai pytorch Lightning
Weaknesses CWE-470
CPEs cpe:2.3:a:lightningai:pytorch_lightning:*:*:*:*:*:python:*:*
Vendors & Products Lightningai
Lightningai pytorch Lightning
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.4, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-470

    Use of Externally-Controlled Input to Select Classes or Code ('Unsafe Reflection')

  • CWE-502

    Deserialization of Untrusted Data

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Nov 8, 2026, 2:07 PM
Reserved
Jul 1, 2026, 9:54 PM
Status
Analyzed
Published
Jul 15, 2026, 6:16 PM
Modified
Oct 24, 2026, 9:10 PM
Severity
Important
Public date
Jul 15, 2026, 5:02 PM