Skip to content
Path traversal Disclosed report Intermediate CVE-2024-8019

PyTorch Lightning path traversal vulnerability

A path traversal vulnerability in PyTorch Lightning's LightningApp on Windows allows an attacker to write or overwrite arbitrary files via a crafted filename at the upload endpoint. This could lead to remote code execution by overwriting critical files or placing malicious files in sensitive locations.

lightning-ai/pytorch-lightning

Originally disclosed on huntr

Critical View original

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.

From the GitHub Advisory Database (GHSA-4cv3-v7pv-rfhf, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application fails to sanitise user-supplied filenames, allowing directory traversal sequences to escape the intended upload directory.

Impact

An attacker could write or overwrite arbitrary files, potentially leading to remote code execution by overwriting critical files or placing malicious files in sensitive locations.

What the attacker needed

Windows host; access to the upload endpoint

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

This is a flaw in a tool called PyTorch Lightning that lets someone upload files to a web server. Because the server does not check the filename properly, an attacker can use a tricky name to save files anywhere on the computer, even outside the intended folder. That could let them replace important system files and run their own code.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More from lightning-ai/pytorch-lightning

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.