CVE-2024-5980 Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning
Attackers can write arbitrary files via path traversal in the /v1/runs API when the plugin server is active, 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-5980?
CVE-2024-5980 is a critical path traversal vulnerability in lightning-ai/pytorch-lightning, published on 27 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
A vulnerability in the /v1/runs API endpoint of lightning-ai/pytorch-lightning v2.2.4 allows attackers to exploit path traversal when extracting tar.gz files. When the LightningApp is running with the plugin_server, attackers can deploy malicious tar.gz plugins that embed arbitrary files with path traversal vulnerabilities. This can result in arbitrary files being written to any directory in the victim's local file system, potentially leading to remote code execution.
Weakness: CWE-22
Which versions are affected by CVE-2024-5980?
4 open source packages ship an affected version, including lightning and pytorch-lightning. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
lightning PyPI | All versions | 2.3.3 |
lightning PyPI | All versions | 2.3.3 |
lightning PyPI | All versions | 2.3.3 |
pytorch-lightning PyPI | All versions | 2.3.3 |
Products include Lightningai Pytorch Lightning.
How do I fix CVE-2024-5980?
Upgrade lightning to 2.3.3 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-5980 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5980 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-8019 Arbitrary File Write/Overwrite 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-mr7h-w2qc-ffc2, PYSEC-2026-386, PYSEC-2026-3975.