CVE-2024-8019: Pytorch lightning Path Traversal Vulnerability
CRITICALCVE-2024-8019 is a CRITICAL (CVSS 9.1) path traversal vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting Pytorch lightning libraries in the PyPI ecosystem. The issue involves pytorch lightning path traversal vulnerability. Remediation is available by upgrading affected packages to version 2.4.0.
CVE-2024-8019 at a Glance
Security Impact
CVSS: 9.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H).
How to Fix CVE-2024-8019
To remediate this vulnerability, upgrade all affected Pytorch lightning dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install pytorch-lightning>=2.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show pytorch-lightning
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2024-8019, inspect your installed packages using pip:
pip show pytorch-lightning
Analyze the terminal output to locate any version of Pytorch lightning in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.0), your application is affected.
Note: The pip show pytorch-lightning command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In Pytorch lightning, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-8019 Affected Pytorch lightning Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
pytorch-lightning
|
PyPI |
< 2.4.0
|
2.4.0
|
References
Frequently Asked Questions
What is CVE-2024-8019?
Which Pytorch lightning versions are affected?
What version fixes CVE-2024-8019?
Is pytorch-lightning affected?
What is the CVSS score of CVE-2024-8019?
What CWE is associated with CVE-2024-8019?
How can I check PyPI dependencies for CVE-2024-8019?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-4cv3-v7pv-rfhf",
"modified" : "2025-03-21T21:56:03Z",
"published" : "2025-03-20T12:32:46Z",
"aliases" : [ "CVE-2024-8019" ],
"summary" : "PyTorch Lightning path traversal vulnerability",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "pytorch-lightning"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-8019"
}, {
"type" : "WEB",
"url" : "https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pytorch/pytorch"
}, {
"type" : "WEB",
"url" : "https://huntr.com/bounties/2754298b-5af5-48ef-8b38-999093ddf2bd"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-434" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-21T21:56:03Z",
"nvd_published_at" : "2025-03-20T10:15:39Z"
}
}