CVE-2024-8019 is a critical-severity (CVSS 9.1) Unrestricted File Upload vulnerability in pytorch-lightning. A fix is available for pytorch-lightning — see the affected versions and patch details below.
Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for CVE-2024-8019.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
pytorch-lightningReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
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.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | pytorch-lightning | all versions | 2.4.0pip install --upgrade 'pytorch-lightning==2.4.0' |
Affected Products
pytorch lightninglightningaiDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for pytorch-lightning, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update pytorch-lightning to 2.4.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-8019 is resolved across your whole dependency graph.
Workarounds
Treat uploaded files as untrusted until proven otherwise: validate the actual content type rather than the supplied extension, store uploads outside the web root on a volume mounted without execute permission, and rename them to server-generated identifiers so an attacker cannot choose the path a request will later resolve.
Frequently Asked Questions
Is CVE-2024-8019 in your dependencies?
Find it across PyPI, including transitive dependencies.