---
id: CVE-2026-58659
title: >-
  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…
summary: >-
  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…
severity: high
cvss: 7.8
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'
cwe:
  - CWE-470
  - CWE-502
published: '2026-07-15'
updated: '2026-07-18'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-58659'
references:
  - url: >-
      https://github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86f
    label: disclosure@vulncheck.com
  - url: 'https://github.com/Lightning-AI/pytorch-lightning/issues/21822'
    label: disclosure@vulncheck.com
  - url: 'https://github.com/Lightning-AI/pytorch-lightning/pull/21832'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter
    label: disclosure@vulncheck.com
  - url: >-
      https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-58659.json
  - url: 'https://access.redhat.com/security/cve/CVE-2026-58659'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2501037'
  - url: 'https://www.cve.org/CVERecord?id=CVE-2026-58659'
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-58659'
  - url: 'https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.6.6'
  - url: 'https://github.com/advisories/GHSA-qqmf-gpg7-g8gw'
  - url: 'https://github.com/Lightning-AI/pytorch-lightning'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-3624.yaml
  - url: 'https://access.redhat.com/errata/RHSA-2026:68699'
  - url: 'https://access.redhat.com/errata/RHSA-2026:68698'
  - url: 'https://access.redhat.com/errata/RHSA-2026:69466'
  - url: 'https://access.redhat.com/errata/RHSA-2026:69467'
  - url: 'https://access.redhat.com/errata/RHSA-2026:70965'
  - url: 'https://access.redhat.com/errata/RHSA-2026:70979'
  - url: >-
      https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3967.yaml
tags:
  - nvd
  - csaf
  - vex
  - red-hat
  - osv
  - pip
  - ghsa
epss: 0.00626
epssPercentile: 0.47718
ingestedAt: '2026-07-18T14:23:38.231Z'
vendor: Red Hat
product: Red Hat AI Inference Server
affected:
  - ai_inference_server
  - enterprise_linux_ai_rhel_ai 3
  - openshift_ai_rhoai
aliases:
  - PYSEC-2026-3967
  - GHSA-qqmf-gpg7-g8gw
  - PYSEC-2026-3624
ecosystem: pip
patched:
  - pytorch-lightning 2.6.6
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Vendor advisories

- **Red Hat VEX** · Important · affected: Red Hat AI Inference Server, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI) · no fix planned: Red Hat AI Inference Server, Red Hat Enterprise Linux AI (RHEL AI) 3, Red Hat OpenShift AI (RHOAI) · updated 2026-09-24 · [vex](https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-58659.json)
- **RHSA-2026:68699** · Red Hat · fixed in: Red Hat AI Inference Server 3.3 · released 2026-09-17 · [advisory](https://access.redhat.com/errata/RHSA-2026:68699)
- **RHSA-2026:68698** · Red Hat · fixed in: Red Hat AI Inference Server 3.3 · released 2026-09-17 · [advisory](https://access.redhat.com/errata/RHSA-2026:68698)
- **RHSA-2026:69466** · Red Hat · fixed in: Red Hat AI Inference Server 3.4 · released 2026-09-21 · [advisory](https://access.redhat.com/errata/RHSA-2026:69466)
- **RHSA-2026:69467** · Red Hat · fixed in: Red Hat AI Inference Server 3.4 · released 2026-09-21 · [advisory](https://access.redhat.com/errata/RHSA-2026:69467)
- **RHSA-2026:70965** · Red Hat · fixed in: Red Hat AI Inference Server 3.4 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:70965)
- **RHSA-2026:70979** · Red Hat · fixed in: Red Hat AI Inference Server 3.4 · released 2026-09-23 · [advisory](https://access.redhat.com/errata/RHSA-2026:70979)

## Package advisory (CVE-2026-58659)

Affected packages:

- `pytorch-lightning < 2.6.6`

Patched in:

- `pytorch-lightning 2.6.6`

Source: https://osv.dev/vulnerability/PYSEC-2026-3967
