PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter
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.
CVE-2026-58659
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2026-58659
pytorch-lightning
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://github.com/Lightning-AI/pytorch-lightning",
"vendor": "Lightning-AI",
"product": "pytorch-lightning",
"versions": [
{
"status": "affected",
"version": "0",
"versionType": "semver",
"lessThanOrEqual": "2.6.5"
},
{
"status": "unaffected",
"version": "d710d689510d50e800f53b3cd773cbca20b1f86f",
"versionType": "git"
}
],
"packageURL": "pkg:pypi/lightning",
"defaultStatus": "unaffected"
}
]- Related CVEs
- CVE-2026-58659
Source reference:
/cveMetadata/cveId
Publisher severity
high
Source reference: /containers/cna/metrics
- Event
- #12768 · Revision 1
- Added to Heist Feed
- Publisher date