CVE-2024-8019 Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning
Attackers can write or overwrite arbitrary files via a crafted filename in the upload endpoint, potentially leading to remote code execution.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-8019?
CVE-2024-8019 is a critical vulnerability in lightning-ai/pytorch-lightning, published on 20 Mar 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
In lightning-ai/pytorch-lightning version 2.3.2, a vulnerability exists in the `LightningApp` when running on a Windows host. The vulnerability occurs at the `/api/v1/upload_file/` endpoint, allowing an attacker to write or overwrite arbitrary files by providing a crafted filename. This can lead to potential remote code execution (RCE) by overwriting critical files or placing malicious files in sensitive locations.
Weakness: CWE-434
Which versions are affected by CVE-2024-8019?
4 open source packages ship an affected version, including pytorch-lightning and lightning. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pytorch-lightning PyPI | All versions | 2.4.0 |
pytorch-lightning PyPI | All versions | 2.4.0 |
pytorch-lightning PyPI | All versions | 2.4.0 |
lightning PyPI | All versions | 2.4.0 |
Products include Lightningai Pytorch Lightning.
How do I fix CVE-2024-8019?
Upgrade pytorch-lightning to 2.4.0 or later.
Is CVE-2024-8019 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-8019 exists.
Other vulnerabilities in lightning-ai/pytorch-lightning
- CVE-2024-5452 RCE via Property/Class Pollution in lightning-ai/pytorch-lightning
- CVE-2026-44484 Compromise of PyTorch Lightning PyPi Package Versions
- CVE-2024-5980 Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning
- CVE-2026-31221 PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization
- CVE-2026-58659 PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter
Sources
Also known as GHSA-4cv3-v7pv-rfhf, PYSEC-2026-3970, PYSEC-2026-507.