# CVE-2024-5980: Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.1
- **CVSS:** 9.1 (v3.0, CNA) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 1.89% (percentile 80, 2026-11-26)
- **CWE:** CWE-22
- **Aliases:** GHSA-mr7h-w2qc-ffc2, PYSEC-2026-386, PYSEC-2026-3975
- **Published:** 2024-06-27T18:46:39.213Z
- **Modified:** 2026-11-16T15:00:09.767Z

## Who should check

- Projects that depend on PyPI package lightning (\< 2.3.3)
- Projects that depend on PyPI package pytorch-lightning (\< 2.3.3)
- Anyone running lightning-ai/pytorch-lightning \>= unspecified, \< 2.3.3

## Description

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.

## Affected and fixed versions

- PyPI `lightning`: affected \< 2.3.3; fixed 2.3.3 (osv)
- PyPI `pytorch-lightning`: affected \< 2.3.3; fixed 2.3.3 (osv)
- lightning-ai/pytorch-lightning: \>= unspecified, \< 2.3.3 (cvelist)

## Mitigation

- Upgrade lightning to 2.3.3 or later.
- Upgrade pytorch-lightning to 2.3.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-5980. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-5980.md
Affected: lightning < 2.3.3; pytorch-lightning < 2.3.3
Fixed in: 2.3.3

Steps:
1. Search this machine and project for lightning (PyPI), pytorch-lightning (PyPI), lightning-ai/pytorch-lightning: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-5980 being exploited?

There is no confirmed exploitation: CVE-2024-5980 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.89% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2024-5980?

Critical: CVSS 9.1 (v3.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-5980?

lightning \< 2.3.3; pytorch-lightning \< 2.3.3.

### Is there a fix for CVE-2024-5980?

Yes. Fixed in 2.3.3. Upgrade lightning to 2.3.3 or later. Upgrade pytorch-lightning to 2.3.3 or later.

### How do I check if I'm affected by CVE-2024-5980?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2024-5980>
- vendor: <https://github.com/advisories/GHSA-mr7h-w2qc-ffc2>
- patch: <https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a>
- patch: <https://github.com/Lightning-AI/pytorch-lightning/pull/20039>
- exploit: <https://huntr.com/bounties/55a6ac6f-89c7-42ea-86f3-c6e93a2679f3>
- other: <https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.3.3>
- other: <https://github.com/lightning-ai/pytorch-lightning>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-386.yaml>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3975.yaml>
- other: <https://pypi.org/project/lightning>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2024-5980>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-mr7h-w2qc-ffc2> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-386> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2026-3975> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-5980> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-5980>
