Skip to main content

PyTorch Lightning CVE-2026-31221

| EUVDEUVD-2026-29505 HIGH
Deserialization of Untrusted Data (CWE-502)
2026-05-12 mitre GHSA-75m9-98v2-hjpm
7.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker crafts malicious .ckpt file
  2. Delivery
    Victim downloads checkpoint (social engineering/typosquatting)
  3. Exploit
    Victim runs load_from_checkpoint()
  4. Execution
    torch.load() deserializes Pickle payload
  5. Persist
    Arbitrary code executes as victim user
  6. Impact
    Attacker establishes persistence/exfiltrates data

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Attack requires the victim to execute Python code that calls LightningModule.load_from_checkpoint() on an attacker-controlled checkpoint file. Specific prerequisite: the target application or script must load external checkpoint files rather than only using internally generated checkpoints. The vulnerability affects default PyTorch Lightning installations without code modifications - no non-default configuration required. Limiting factors include: (1) Local attack vector (AV:L) requires the malicious checkpoint file to be present on the victim's filesystem, typically via social engineering, supply chain compromise, or compromised model repositories; (2) User interaction required (UI:R) - the victim must actively execute code to load the checkpoint, it does not auto-execute; (3) No privilege requirements (PR:N) means any user account can be exploited, but execution occurs with the victim's existing privileges, not elevated access. The attack does not work against systems that only load checkpoints from cryptographically verified sources or use custom loading code with weights_only=True.

Impact

Real-world risk is moderate and highly context-dependent. The CVSS base score of 7.8 (High) reflects maximum impact (code execution with full system privileges), but the attack vector is Local with Required user interaction, significantly constraining exploitation scenarios. The low EPSS score (0.06%, 19th percentile) suggests minimal observed exploitation attempts in the wild, and absence from CISA KEV confirms no known active exploitation campaigns. However, these traditional risk signals may underestimate threat in machine learning contexts where checkpoint sharing is common practice. Researchers routinely download pre-trained models from GitHub, Hugging Face, academic repositories, and collaborative platforms - often without verification. The ML community's trust-based culture and lack of checkpoint integrity verification creates practical remote attack paths via social engineering or typosquatting. Priority depends heavily on organizational context: high-risk for organizations that download external checkpoints or operate model sharing platforms; low-risk for isolated research environments using only internally generated checkpoints. The vulnerability is not automatable at scale (requires per-victim social engineering), but technical impact is critical (full RCE). SSVC decision tree likely yields 'Scheduled' rather than 'Immediate' priority for most organizations.

Exploit ScenarioDerived

An attacker creates a malicious PyTorch Lightning checkpoint file containing a weaponized Pickle payload that executes a reverse shell when deserialized. They publish this checkpoint on GitHub or Hugging Face disguised as a popular pre-trained model (e.g., 'bert-base-optimized.ckpt'). A data scientist researching NLP downloads the checkpoint and loads it using model = MyLightningModule.load_from_checkpoint('bert-base-optimized.ckpt') in their development environment. The torch.load() call deserializes the Pickle payload, executing the attacker's code with the data scientist's privileges, establishing persistence and exfiltrating proprietary training data or source code. No public proof-of-concept exists at time of analysis, but the exploit technique is well-documented in Python security research.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 14, 2026

Arbitrary code execution occurs in PyTorch Lightning 2.6.0 and earlier when loading malicious checkpoint files. The LightningModule.load_from_checkpoint() method deserializes untrusted Pickle data without security restrictions, allowing attackers to execute arbitrary Python code when victims open crafted .ckpt files. EPSS score of 0.06% (19th percentile) indicates low observed exploitation probability, and no public exploit code or CISA KEV listing exists at time of analysis. Attack requires local access and user interaction (opening a malicious checkpoint), limiting remote attack scenarios to social engineering or supply chain compromise.

RemediationAI

Upstream fix version not independently confirmed from available data - vendors should consult the official PyTorch Lightning GitHub repository and security advisories for patch availability. Until patched versions are deployed, implement these specific mitigations: (1) Modify code to use torch.load(checkpoint_path, weights_only=True) directly instead of load_from_checkpoint(), then manually instantiate the LightningModule - this breaks compatibility with checkpoints containing custom Python objects but eliminates code execution risk; (2) Implement cryptographic signature verification for all checkpoint files using HMAC-SHA256 or digital signatures before loading, rejecting unsigned or invalid files; (3) Restrict checkpoint loading to files from trusted internal sources only, blocking external downloads via network policies; (4) Run checkpoint loading operations in isolated containers or virtual machines with no network access and minimal privileges, treating all checkpoints as untrusted until validated. Trade-offs: weights_only=True breaks legitimate use cases requiring custom callbacks or objects in checkpoints; signature verification requires key management infrastructure; container isolation adds operational complexity. Organizations sharing models publicly should publish checksums/signatures alongside checkpoint files. Monitor PyTorch Lightning release notes at https://github.com/Lightning-AI/pytorch-lightning/releases for security patches.

Affected VersionsENISA

n/a n/a

Affected Packages

pypi lightning no fix
pypi pytorch-lightning no fix

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 high-level PyTorch wrapper framework for organizing machine learning research code. The vulnerability stems from insecure deserialization (CWE-502) in the checkpoint persistence mechanism. Model checkpoints in PyTorch are typically serialized using Python's Pickle module, which can execute arbitrary code during deserialization. PyTorch introduced the weights_only=True parameter in torch.load() to restrict deserialization to tensors only, preventing code execution. However, PyTorch Lightning's load_from_checkpoint() wrapper method calls torch.load() with default parameters (weights_only=False), allowing full object deserialization. This design choice prioritizes backward compatibility over security, creating a code execution vector when loading untrusted checkpoint files.

Know when Checkpoint 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

NVD PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Red Hat 8.0 HIGH

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

3
CVSS changed
May 14, 2026 - 19:07 NVD
7.8 (HIGH)
CVE Published
May 12, 2026 - 00:00 nvd
HIGH 7.8
CVE Published
May 12, 2026 - 00:00 nvd
UNKNOWN (no severity yet)

DescriptionCVE.org

PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism. The LightningModule.load_from_checkpoint() method, which is commonly used to load saved model states, internally calls torch.load() without setting the security-restrictive weights_only=True parameter. This default behavior allows the deserialization of arbitrary Python objects via the Pickle module. A remote attacker can exploit this by providing a maliciously crafted checkpoint file, leading to arbitrary code execution on the victim's system when the file is loaded.

Executive ViewAI

Why It Matters

PyTorch Lightning versions 2.6.0 and earlier contain an arbitrary code execution vulnerability in checkpoint file loading that could allow attackers to execute malicious code when users open specially crafted model files. This risk primarily affects data science and ML engineering teams who work with external or untrusted checkpoint files, and poses a supply chain threat if compromised models are distributed through model repositories or shared collaborations.

Business Impact: Medium
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) restrict checkpoint file loading to internally-generated and cryptographically-verified model files only; (2) implement network-based controls preventing untrusted external checkpoint downloads; (3) require code review before any checkpoint loading operations in production ML pipelines; (4) isolate ML development environments from production systems; (5) monitor for PyTorch Lightning security advisories for patch availability; (6) consider containerization with restricted filesystem access for checkpoint operations.

Threat Intelligence Overview

EPSS Score
0.1%
Top 81% exploitable
Threat Intel
2
1 sources
Data Quality
5 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA MAL Vendor GitHub VulDB

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Defer
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
Medium
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

CVE-2014-6271 CRITICAL POC
9.8 Sep 24

GNU Bash through 4.3 processes trailing strings after function definitions in the values of environment variables, which

CVE-2024-24919 HIGH POC
8.6 May 28

Potentially allowing an attacker to read certain information on Check Point Security Gateways once connected to the inte

CVE-2014-7169 CRITICAL POC
9.8 Sep 25

GNU Bash through 4.3 bash43-025 processes trailing strings after certain malformed function definitions in the values of

CVE-2017-1000083 HIGH POC
7.8 Sep 05

backend/comics/comics-document.c (aka the comic book backend) in GNOME Evince before 3.24.1 allows remote attackers to e

CVE-2026-85102 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway arises from improper certificate trust validation during V

CVE-2026-16232 CRITICAL POC
9.3 Jul 22

Authentication bypass in the Check Point SmartConsole login process lets an unauthenticated remote attacker mint a valid

CVE-2026-50751 CRITICAL POC
9.3 Jun 08

Authentication bypass in Check Point Quantum Security Gateway and Spark Firewalls allows unauthenticated remote attacker

CVE-2026-93616 CRITICAL POC
9.8 Sep 22

Unauthenticated attackers who can reach the file-upload interface of Check Point Management Server can combine directory

CVE-2021-3449 MEDIUM
5.9 Mar 25

An OpenSSL TLS server may crash if sent a maliciously crafted renegotiation ClientHello message from a client. Rated med

CVE-2026-85103 CRITICAL POC
9.8 Sep 09

Remote code execution in Check Point Quantum Security Gateway and Quantum Security Management stems from a heap-based bu

CVE-2026-91843 CRITICAL POC
9.8 Sep 16

Unauthenticated remote code execution affects Check Point Quantum Security Management, where a stack-based buffer overfl

CVE-2024-3568 CRITICAL POC
9.6 Apr 10

The huggingface/transformers library is vulnerable to arbitrary code execution through deserialization of untrusted data

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy