PyPA Advisory Database
PYSEC-2026-507
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.
Affected packages
| Ecosystem | Package | Affected versions |
|---|---|---|
| PyPI | pytorch-lightning | All versions before 2.4.0 (fixed in 2.4.0) |
References
- https://nvd.nist.gov/vuln/detail/CVE-2024-8019
- https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a
- https://github.com/pytorch/pytorch
- https://huntr.com/bounties/2754298b-5af5-48ef-8b38-999093ddf2bd
- https://pypi.org/project/pytorch-lightning
- https://github.com/advisories/GHSA-4cv3-v7pv-rfhf