CVE-2024-8019 Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning

Critical 9.1 Published Updated

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.

PackageAffectedFixed in
pytorch-lightning PyPIAll versions2.4.0
pytorch-lightning PyPIAll versions2.4.0
pytorch-lightning PyPIAll versions2.4.0
lightning PyPIAll versions2.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.

Sources

Also known as GHSA-4cv3-v7pv-rfhf, PYSEC-2026-3970, PYSEC-2026-507.

Is CVE-2024-8019 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free