---
id: "CVE-2024-5980"
page: "https://infrastack.ai/live/CVE-2024-5980"
kind: "vulnerability"
aliases: ["CVE-2024-5980", "GHSA-mr7h-w2qc-ffc2"]
title: "pytorch-lightning vulnerable to Arbitrary File Write via /v1/runs API endpoint"
severity: "critical"
cvss: 9.8
epss: 0.01318
exploited: false
status: "open"
category: "package"
products: [{"name": "lightning", "fixed": ["2.3.3"], "affected": "< 2.3.3", "ecosystem": "pypi"}, {"name": "pytorch-lightning", "fixed": ["2.3.3"], "affected": "< 2.3.3", "ecosystem": "pypi"}, {"name": "lightningai pytorch lightning", "fixed": ["2.3.3"], "affected": ">= 2.2.4, < 2.3.3", "ecosystem": "vendor"}]
ecosystems: ["pypi", "vendor"]
tags: ["cwe-22", "cwe-434", "lightning", "ml-platform", "package", "python", "pytorch-lightning"]
not_affected_if: ["library-only-use", "plugin-server-disabled"]
published_at: "2024-06-27T19:15:18+00:00"
first_seen_at: "2026-11-16T14:46:30+00:00"
updated_at: "2026-11-16T15:07:30+00:00"
sources: [{"source": "ghsa", "url": "https://github.com/advisories/GHSA-mr7h-w2qc-ffc2", "first_seen_at": "2026-11-16T14:46:30+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5980", "first_seen_at": "2026-11-16T15:07:30+00:00"}]
exploit_sources: [{"type": "poc", "url": "https://huntr.com/bounties/55a6ac6f-89c7-42ea-86f3-c6e93a2679f3"}, {"type": "epss", "score": 0.01318, "url": "https://api.first.org/data/v1/epss?cve=CVE-2024-5980"}]
---

# pytorch-lightning vulnerable to Arbitrary File Write via /v1/runs API endpoint

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

The /v1/runs API endpoint extracts uploaded tar.gz plugins without checking file paths, so a crafted archive can write files anywhere on disk. An attacker who can reach the endpoint can overwrite files on the host, which can lead to remote code execution.

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

## Affected

- pypi:lightning affected < 2.3.3 fixed 2.3.3
- pypi:pytorch-lightning affected < 2.3.3 fixed 2.3.3
- vendor:lightningai pytorch lightning affected >= 2.2.4, < 2.3.3 fixed 2.3.3

## How to check

- Check the installed version with `pip show lightning` and `pip show pytorch-lightning`.
- Look for a LightningApp running with the plugin_server enabled and reachable from your network.

## Fix

- `lightning` and `pytorch-lightning`: move to `2.3.3` or later.

## Timeline

- 2026-11-16T14:46:30+00:00 ghsa https://github.com/advisories/GHSA-mr7h-w2qc-ffc2
- 2026-11-16T15:07:30+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-5980

## Documents

- [fix] Patch: github.com https://github.com/Lightning-AI/pytorch-lightning/pull/20039
- [fix] Release: github.com https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.3.3
- [fix] Patch: github.com https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a
- [poc] Exploit: huntr.com https://huntr.com/bounties/55a6ac6f-89c7-42ea-86f3-c6e93a2679f3

## From the sources

A vulnerability in the /v1/runs API endpoint of lightning-ai/pytorch-lightning v2.2.4 allows attackers to exploit path traversal when extracting tar.gz files. When the LightningApp is running with the plugin_server, attackers can deploy malicious tar.gz plugins that embed arbitrary files with path traversal vulnerabilities. This can result in arbitrary files being written to any directory in the victim's local file system, potentially leading to remote code execution.

---

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