---
id: "CVE-2024-8019"
page: "https://infrastack.ai/live/CVE-2024-8019"
kind: "vulnerability"
aliases: ["CVE-2024-8019", "GHSA-4cv3-v7pv-rfhf"]
title: "PyTorch Lightning path traversal vulnerability"
severity: "critical"
cvss: 9.1
epss: 0.01122
exploited: false
status: "open"
category: "package"
products: [{"name": "pytorch-lightning", "fixed": ["2.4.0"], "affected": "< 2.4.0", "ecosystem": "pypi"}, {"name": "lightning", "fixed": ["2.4.0"], "affected": "< 2.4.0", "ecosystem": "pypi"}, {"name": "lightningai pytorch lightning", "fixed": [], "affected": "= 2.3.2", "ecosystem": "vendor"}, {"via": "cpe", "name": "lightning", "fixed": [], "affected": "= 2.3.2", "ecosystem": "pypi"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-434", "lightning", "ml-training", "package", "python", "pytorch-lightning", "windows"]
not_affected_if: ["fixed-version-2.4.0", "no-lightningapp", "non-windows-host"]
published_at: "2025-03-20T10:15:39+00:00"
first_seen_at: "2026-11-16T16:13:26+00:00"
updated_at: "2026-11-16T16:38:06+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-4cv3-v7pv-rfhf", "first_seen_at": "2026-11-16T16:13:26+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-8019", "first_seen_at": "2026-11-16T16:38:06+00:00"}]
exploit_sources: [{"type": "poc", "url": "https://huntr.com/bounties/2754298b-5af5-48ef-8b38-999093ddf2bd"}, {"type": "epss", "score": 0.01122, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-8019"}]
---

# PyTorch Lightning path traversal vulnerability

Link for people: https://infrastack.ai/live/CVE-2024-8019 (this .md is for agents)

PyTorch Lightning's LightningApp upload endpoint (/api/v1/upload_file/) accepts a crafted filename on Windows hosts and writes files outside the intended directory. An attacker can overwrite critical files or plant malicious ones, which can lead to remote code execution.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- pypi:pytorch-lightning affected < 2.4.0 fixed 2.4.0
- pypi:lightning affected < 2.4.0 fixed 2.4.0
- vendor:lightningai pytorch lightning affected = 2.3.2 fixed no fixed version listed
- pypi:lightning affected = 2.3.2 fixed no fixed version listed

## How to check

- Check the installed version with `pip show pytorch-lightning` and `pip show lightning`; versions below `2.4.0` are affected.
- Look for a running LightningApp on a Windows host that exposes the `/api/v1/upload_file/` endpoint.

## Fix

- `pytorch-lightning` and `lightning`: upgrade to `2.4.0`.

## Timeline

- 2026-11-16T16:13:26+00:00 ghsa https://github.com/advisories/GHSA-4cv3-v7pv-rfhf
- 2026-11-16T16:38:06+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-8019

## Documents

- [fix] Patch: github.com https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a
- [poc] Exploit: huntr.com https://huntr.com/bounties/2754298b-5af5-48ef-8b38-999093ddf2bd

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
