{"id":"CVE-2024-8019","kind":"vulnerability","aliases":["CVE-2024-8019","GHSA-4cv3-v7pv-rfhf"],"related":[],"title":"PyTorch Lightning path traversal vulnerability","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.","summary":"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.","severity":"critical","cvss":9.1,"epss":0.01122,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Check the installed version with `pip show pytorch-lightning` and `pip show lightning`; versions below `2.4.0` are affected.\n- 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`.","status":"open","published_at":"2025-03-20T10:15:39+00:00","first_seen_at":"2026-11-16T16:13:26+00:00","triaged_at":"2026-11-16T16:15:07+00:00","updated_at":"2026-11-16T16:38:06+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T16:15:07Z","model":"claude-haiku-5-5","output":{"fix":"- `pytorch-lightning` and `lightning`: upgrade to `2.4.0`.","reach":"network","title":"PyTorch Lightning: crafted upload filename on Windows writes arbitrary files","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["pytorch-lightning","lightning","python","windows","ml-training"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"Attacker writes files on the host, possibly achieving remote code execution.","analyst_note":"","how_to_check":"- Check the installed version with `pip show pytorch-lightning` and `pip show lightning`; versions below `2.4.0` are affected.\n- Look for a running LightningApp on a Windows host that exposes the `/api/v1/upload_file/` endpoint.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["fixed-version-2.4.0","no-lightningapp","non-windows-host"],"who_is_affected":"Teams running LightningApp from pytorch-lightning or lightning older than 2.4.0 on Windows hosts, where the upload endpoint is reachable. The sources describe the issue for version 2.3.2 on Windows; Linux and macOS are not mentioned. Projects that do not run LightningApp or that are on 2.4.0 or later are not affected.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000773,"input_tokens":4674,"output_tokens":611,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2024':7A,15A '-434':26B '-8019':8A,16A '/api/v1/upload_file':43B,99C '/pytorch-lightning':79C '2.3.2':81C '4cv3':11A 'accept':44B 'ai':78C 'allow':101C 'arbitrari':108C 'attack':59B,103C 'code':73B,121C 'craft':46B,113C 'critic':62B,126C 'cve':6A,14A 'cwe':25B 'directori':57B 'endpoint':42B,100C 'execut':74B,122C 'exist':84C 'file':53B,63B,109C,127C,131C 'filenam':47B,114C 'ghsa':10A 'ghsa-4cv3-v7pv-rfhf':9A 'host':50B,93C 'intend':56B 'lead':70B,117C 'lightn':2A,27B,35B,38B,77C 'lightning':19A,20A,23A,24A 'lightning-ai':76C 'lightningai':21A 'lightningapp':40B,87C 'locat':134C 'malici':66B,130C 'ml':29B 'ml-train':28B 'occur':96C 'one':67B 'outsid':54B 'overwrit':61B,107C,125C 'packag':31B 'path':3A 'place':129C 'plant':65B 'potenti':119C 'provid':111C 'python':32B 'pytorch':1A,18A,22A,34B,37B 'pytorch-lightn':33B 'pytorch-lightning':17A 'rce':123C 'remot':72B,120C 'rfhf':13A 'run':89C 'sensit':133C 'train':30B 'travers':4A 'upload':41B 'v7pv':12A 'version':80C 'vulner':5A,83C,95C 'window':36B,49B,92C 'write':52B,105C","nicknames":[],"mitigations":[],"who_affected":"Teams running LightningApp from pytorch-lightning or lightning older than 2.4.0 on Windows hosts, where the upload endpoint is reachable. The sources describe the issue for version 2.3.2 on Windows; Linux and macOS are not mentioned. Projects that do not run LightningApp or that are on 2.4.0 or later are not affected.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":["lightning","lightningaipytorchlightning","pytorchlightning"],"ptokens":["lightning","lightningai","pytorch"],"labels":["critical","cwe434","lightning","mltraining","package","pypi","python","pytorchlightning","vendor","windows"],"campaign_type":null,"search_a":"'-2024':7A,15A '-8019':8A,16A '4cv3':11A 'cve':6A,14A 'ghsa':10A 'ghsa-4cv3-v7pv-rfhf':9A 'lightn':2A 'lightning':19A,20A,23A,24A 'lightningai':21A 'path':3A 'pytorch':1A,18A,22A 'pytorch-lightning':17A 'rfhf':13A 'travers':4A 'v7pv':12A 'vulner':5A","search_b":"'-434':26B '/api/v1/upload_file':43B 'accept':44B 'attack':59B 'code':73B 'craft':46B 'critic':62B 'cwe':25B 'directori':57B 'endpoint':42B 'execut':74B 'file':53B,63B 'filenam':47B 'host':50B 'intend':56B 'lead':70B 'lightn':27B,35B,38B 'lightningapp':40B 'malici':66B 'ml':29B 'ml-train':28B 'one':67B 'outsid':54B 'overwrit':61B 'packag':31B 'plant':65B 'python':32B 'pytorch':34B,37B 'pytorch-lightn':33B 'remot':72B 'train':30B 'upload':41B 'window':36B,49B 'write':52B","search_c":"'/api/v1/upload_file':99C '/pytorch-lightning':79C '2.3.2':81C 'ai':78C 'allow':101C 'arbitrari':108C 'attack':103C 'code':121C 'craft':113C 'critic':126C 'endpoint':100C 'execut':122C 'exist':84C 'file':109C,127C,131C 'filenam':114C 'host':93C 'lead':117C 'lightn':77C 'lightning-ai':76C 'lightningapp':87C 'locat':134C 'malici':130C 'occur':96C 'overwrit':107C,125C 'place':129C 'potenti':119C 'provid':111C 'rce':123C 'remot':120C 'run':89C 'sensit':133C 'version':80C 'vulner':83C,95C 'window':92C 'write':105C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2025-03-20T10:15:39+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","cvss_by":"GitHub","poc_count":1,"sources":[{"source":"ghsa","external_id":"GHSA-4cv3-v7pv-rfhf","url":"https://github.com/advisories/GHSA-4cv3-v7pv-rfhf","severity":"critical","published_at":"2025-03-20T12:32:46+00:00","modified_at":"2026-11-16T16:13:01+00:00","first_seen_at":"2026-11-16T16:13:26+00:00","fetched_at":"2026-11-16T16:18:39+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-8019","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-8019","severity":null,"published_at":"2025-03-20T10:15:39+00:00","modified_at":"2026-06-17T08:21:41+00:00","first_seen_at":"2026-11-16T16:38:06+00:00","fetched_at":"2026-11-16T16:38:06+00:00","note":null}],"documents":[{"id":170089,"url":"https://github.com/lightning-ai/pytorch-lightning/commit/330af381de88cff17515418a341cbc1f9f127f9a","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":171323,"url":"https://huntr.com/bounties/2754298b-5af5-48ef-8b38-999093ddf2bd","title":"Exploit: huntr.com","kind":"poc","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"poc","confidence":null,"note":"Exploit: huntr.com"}],"disclosures":[],"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"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}