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.
Published: 2026-07-15
Score: 8.4 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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

No advisories yet.

History

Sat, 18 Jul 2026 01:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Fri, 17 Jul 2026 00:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-502
References
Metrics threat_severity

None

threat_severity

Important


Wed, 15 Jul 2026 17:30:00 +0000

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'}


Subscriptions

Lightningai Pytorch Lightning
cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-18T01:03:17.592Z

Reserved: 2026-07-01T21:54:37.946Z

Link: CVE-2026-58659

cve-icon Vulnrichment

Updated: 2026-07-18T01:03:13.776Z

cve-icon NVD

No data.

cve-icon Redhat

Severity : Important

Publid Date: 2026-07-15T17:02:40Z

Links: CVE-2026-58659 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T03:30:18Z

Weaknesses
  • CWE-470

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

  • CWE-502

    Deserialization of Untrusted Data