Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious .ckpt with _instantiator=os.system
-
DeliveryDistribute checkpoint via model hub or shared storage
-
ExploitVictim calls load_from_checkpoint
-
Execution_load_state imports attacker module path
-
ImpactArbitrary code executes with victim privileges
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V15 - Secure Coding and Architecture Reflection safety, class allowlisting
|
| Exploitation Conditions | Exploitation requires that a victim load an attacker-supplied checkpoint via LightningModule.load_from_checkpoint (the underlying _load_state path); specifically the malicious .ckpt must set hyper_parameters['_instantiator'] to an arbitrary importable path (the POC/test uses 'os.system'), which unpatched Lightning imports and executes. Critically, torch weights_only=True does NOT prevent it, because execution occurs in Lightning's own instantiator-resolution logic rather than in pickle. Limiting factors: the vector is local (AV:L) and requires active user interaction (UI:A) - the attacker cannot trigger it remotely and must convince the victim to obtain and load the crafted checkpoint; no authentication or special privileges are needed to craft the file (PR:N), and it works against default configurations of affected versions with no non-default feature required. Deployments that only ever load self-produced, trusted checkpoints are effectively not exposed. |
| Impact | The vendor CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H, base 8.4) correctly frames this as a local, low-complexity, unauthenticated flaw whose exploitation hinges on active user interaction - the victim must load an attacker-supplied checkpoint. No EPSS/exploitation-probability figure is supplied and there is no CISA KEV listing, so there is no evidence of active in-the-wild exploitation; however, publicly available exploit code exists and the patch's own test case (using os.system as the instantiator) shows exploitation is trivial once a malicious file is loaded. The realistic risk is high in ML supply-chain contexts where practitioners routinely download pretrained checkpoints from model hubs or shared storage and load them without provenance checks - a common habit this flaw weaponizes. It is not remotely exploitable against a service (AV:L, UI:A), so it is not a wormable or mass-exploitation network threat; it is a targeted social-engineering / supply-chain vector. The signals are consistent (local vector, high technical impact, POC available) with no conflicts, though the absence of an EPSS score means widespread automated-exploitation likelihood cannot be quantified from the input. |
| Exploit ScenarioDerived | An attacker publishes an attractive pretrained model checkpoint (e.g., on a model-sharing hub or shared drive) whose hyper_parameters include _instantiator set to a dangerous import path such as os.system. When a data scientist runs LightningModule.load_from_checkpoint on the file - even with weights_only=True - Lightning imports and executes that path, running arbitrary code with the victim's privileges. A public POC demonstrating this via the _instantiator field exists. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 15, 2026
Remote code execution in PyTorch Lightning through 2.6.5 allows an attacker who can get a victim to load a malicious checkpoint file to execute arbitrary code. The flaw lives in the _load_state routine, which imports and calls the module path named in a checkpoint's _instantiator hyperparameter, letting a crafted .ckpt bypass torch's weights_only=True safeguard when LightningModule.load_from_checkpoint is invoked. Reported by VulnCheck, it is fixed in commit d710d68 (PR #21832) via an instantiator allowlist, and publicly available exploit code exists though it is not listed in CISA KEV.
RemediationAI
Upgrade to a PyTorch Lightning build containing fix commit d710d689510d50e800f53b3cd773cbca20b1f86f (PR #21832), which restricts the checkpoint _instantiator hyperparameter to an allowlist (_ALLOWED_INSTANTIATORS = lightning.pytorch.cli.instantiate_module and pytorch_lightning.cli.instantiate_module) and raises a ValueError on any other path; the upstream fix is confirmed, but a specific tagged/PyPI release version is not stated in the provided data, so verify the fixed version against the vendor advisory (https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter) before pinning. Until patched, only load checkpoints from trusted, provenance-verified sources and never load third-party or user-uploaded .ckpt files, since weights_only=True does NOT mitigate this bug; as a compensating control, inspect a checkpoint's hyper_parameters['_instantiator'] value before loading and reject anything that is not an lightning.pytorch.cli / pytorch_lightning.cli instantiate_module path, or run load_from_checkpoint inside a sandboxed, network-isolated, least-privilege process so any code execution is contained. The trade-off of restricting to trusted checkpoints is operational friction in workflows that consume community models, and manual _instantiator inspection is error-prone compared with upgrading.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
PyTorch Lightning is a widely used high-level training framework layered on top of PyTorch. Checkpoints are Python objects serialized with torch.save; recent PyTorch versions added weights_only=True to torch.load to block the classic pickle-based code-execution path during deserialization. This vulnerability is a distinct, application-level bypass: Lightning stores an _instantiator hyperparameter (an import path string) inside the checkpoint's hyper_parameters, and _load_state in src/lightning/pytorch/core/saving.py dynamically imports and invokes whatever module path that string names. This is a textbook CWE-470 (Use of Externally-Controlled Input to Select Classes or Code / unsafe reflection) issue - trusted control flow is driven by attacker-controlled data, so weights_only=True offers no protection because the dangerous import happens in Lightning's own logic after load, not inside pickle. The affected package is cpe:2.3:a:lightning-ai:pytorch-lightning.
Know when Pytorch Lightning gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
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
Local because a checkpoint file must be loaded (AV:L) with required victim interaction (UI:R); crafting the file needs no attacker privileges (PR:N), and code execution yields full C/I/A impact.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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.
Blast Radius
ecosystem impact- 985 pypi packages depend on lightning (594 direct, 402 indirect)
- 1,744 pypi packages depend on pytorch-lightning (669 direct, 1,150 indirect)
Ecosystem-wide dependent count for version 2.6.6 and other introduced versions.
Executive ViewAI
A vulnerability in PyTorch Lightning through version 2.6.5 allows attackers to execute arbitrary code on systems when users load malicious machine learning model files, threatening AI/ML infrastructure and intellectual property. Organizations using PyTorch Lightning-particularly those training models with external data or consuming open-source models-face potential system compromise and data theft. Publicly available exploit code exists, making practical attacks likely without immediate remediation.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
More in Pytorch Lightning
View allA vulnerability in the /v1/runs API endpoint of lightning-ai/pytorch-lightning v2.2.4 allows attackers to exploit path t
A remote code execution (RCE) vulnerability exists in the lightning-ai/pytorch-lightning library version 2.2.1 due to im
Code Injection in GitHub repository pytorchlightning/pytorch-lightning prior to 1.6.0. Rated critical severity (CVSS 9.8
pytorch-lightning is vulnerable to Deserialization of Untrusted Data. Rated high severity (CVSS 7.8), this vulnerability
A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sendi
In lightning-ai/pytorch-lightning version 2.3.2, a vulnerability exists in the `LightningApp` when running on a Windows
EUVD-2026-44751
GHSA-qqmf-gpg7-g8gw
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB