{"id":"CVE-2024-5980","kind":"vulnerability","aliases":["CVE-2024-5980","GHSA-mr7h-w2qc-ffc2"],"related":[],"title":"pytorch-lightning vulnerable to Arbitrary File Write via /v1/runs API endpoint","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.","summary":"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.","severity":"critical","cvss":9.8,"epss":0.01318,"exploited":false,"exploited_at":null,"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"],"how_to_check":"- Check the installed version with `pip show lightning` and `pip show pytorch-lightning`.\n- 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.","status":"open","published_at":"2024-06-27T19:15:18+00:00","first_seen_at":"2026-11-16T14:46:30+00:00","triaged_at":"2026-11-16T14:47:38+00:00","updated_at":"2026-11-16T15:07:30+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T14:47:38Z","model":"claude-haiku-5-5","output":{"fix":"- `lightning` and `pytorch-lightning`: move to `2.3.3` or later.","reach":"network","title":"PyTorch Lightning: path traversal in /v1/runs lets attackers write arbitrary files","impact":"high","summary":"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.","audience":"developers","category":"package","nicknames":[],"who_cares":["pytorch-lightning","lightning","python","ml-platform"],"confidence":0.8,"fix_status":"available","needs_auth":"unknown","worst_case":"Attacker writes arbitrary files, possibly achieving remote code execution.","analyst_note":"","how_to_check":"- Check the installed version with `pip show lightning` and `pip show pytorch-lightning`.\n- Look for a LightningApp running with the plugin_server enabled and reachable from your network.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["plugin-server-disabled","library-only-use"],"who_is_affected":"Only teams running a LightningApp with plugin_server enabled, where the /v1/runs endpoint accepts tar.gz plugin uploads. Projects that only import the library for training, without running that app server, are not exposed by this flaw. The sources do not say whether the endpoint requires authentication.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"yes","severity_if_unknown":"critical"},"cost_usd":0.000756,"input_tokens":4743,"output_tokens":563,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2024':14A,22A '-22':32B '-434':34B '-5980':15A,23A '/pytorch-lightning':97C '/v1/runs':10A,45B,90C 'ai':96C 'allow':99C 'anywher':63B 'api':11A,46B,91C 'arbitrari':6A,126C,136C 'archiv':59B 'attack':67B,100C,118C 'check':53B 'code':84B,154C 'craft':58B 'cve':13A,21A 'cwe':31B,33B 'deploy':120C 'directori':142C 'disk':65B 'emb':125C 'endpoint':12A,47B,72B,92C 'execut':85B,155C 'exploit':102C 'extract':48B,106C 'ffc2':20A 'file':7A,54B,62B,75B,108C,127C,137C,148C 'ghsa':17A 'ghsa-mr7h-w2qc-ffc2':16A 'host':78B 'lead':81B,151C 'lightn':3A,35B,43B,95C 'lightning':24A,27A,30A 'lightning-ai':94C 'lightningai':28A 'lightningapp':111C 'local':147C 'malici':121C 'ml':37B 'ml-platform':36B 'mr7h':18A 'overwrit':74B 'packag':39B 'path':55B,103C,129C 'platform':38B 'plugin':51B,116C,123C 'potenti':150C 'python':40B 'pytorch':2A,26A,29A,42B 'pytorch-lightn':1A,41B 'pytorch-lightning':25A 'reach':70B 'remot':83B,153C 'result':134C 'run':113C 'server':117C 'system':149C 'tar.gz':50B,107C,122C 'travers':104C,130C 'upload':49B 'v2.2.4':98C 'via':9A 'victim':145C 'vulner':4A,87C,131C 'w2qc':19A 'without':52B 'write':8A,61B 'written':139C","nicknames":[],"mitigations":[],"who_affected":"Only teams running a LightningApp with plugin_server enabled, where the /v1/runs endpoint accepts tar.gz plugin uploads. Projects that only import the library for training, without running that app server, are not exposed by this flaw. The sources do not say whether the endpoint requires authentication.","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","cwe22","cwe434","lightning","mlplatform","package","pypi","python","pytorchlightning","vendor"],"campaign_type":null,"search_a":"'-2024':14A,22A '-5980':15A,23A '/v1/runs':10A 'api':11A 'arbitrari':6A 'cve':13A,21A 'endpoint':12A 'ffc2':20A 'file':7A 'ghsa':17A 'ghsa-mr7h-w2qc-ffc2':16A 'lightn':3A 'lightning':24A,27A,30A 'lightningai':28A 'mr7h':18A 'pytorch':2A,26A,29A 'pytorch-lightn':1A 'pytorch-lightning':25A 'via':9A 'vulner':4A 'w2qc':19A 'write':8A","search_b":"'-22':32B '-434':34B '/v1/runs':45B 'anywher':63B 'api':46B 'archiv':59B 'attack':67B 'check':53B 'code':84B 'craft':58B 'cwe':31B,33B 'disk':65B 'endpoint':47B,72B 'execut':85B 'extract':48B 'file':54B,62B,75B 'host':78B 'lead':81B 'lightn':35B,43B 'ml':37B 'ml-platform':36B 'overwrit':74B 'packag':39B 'path':55B 'platform':38B 'plugin':51B 'python':40B 'pytorch':42B 'pytorch-lightn':41B 'reach':70B 'remot':83B 'tar.gz':50B 'upload':49B 'without':52B 'write':61B","search_c":"'/pytorch-lightning':97C '/v1/runs':90C 'ai':96C 'allow':99C 'api':91C 'arbitrari':126C,136C 'attack':100C,118C 'code':154C 'deploy':120C 'directori':142C 'emb':125C 'endpoint':92C 'execut':155C 'exploit':102C 'extract':106C 'file':108C,127C,137C,148C 'lead':151C 'lightn':95C 'lightning-ai':94C 'lightningapp':111C 'local':147C 'malici':121C 'path':103C,129C 'plugin':116C,123C 'potenti':150C 'remot':153C 'result':134C 'run':113C 'server':117C 'system':149C 'tar.gz':107C,122C 'travers':104C,130C 'v2.2.4':98C 'victim':145C 'vulner':87C,131C 'written':139C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-06-27T19:15:18+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-mr7h-w2qc-ffc2","url":"https://github.com/advisories/GHSA-mr7h-w2qc-ffc2","severity":"critical","published_at":"2024-06-27T21:32:08+00:00","modified_at":"2026-11-16T14:43:15+00:00","first_seen_at":"2026-11-16T14:46:30+00:00","fetched_at":"2026-11-16T14:56:04+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-5980","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-5980","severity":null,"published_at":"2024-06-27T19:15:18+00:00","modified_at":"2026-06-17T08:17:01+00:00","first_seen_at":"2026-11-16T15:07:30+00:00","fetched_at":"2026-11-16T15:07:30+00:00","note":null}],"documents":[{"id":170087,"url":"https://github.com/Lightning-AI/pytorch-lightning/pull/20039","title":"Patch: github.com","kind":"other","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":170088,"url":"https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.3.3","title":"Release: github.com","kind":"release","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release: github.com"},{"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":170299,"url":"https://huntr.com/bounties/55a6ac6f-89c7-42ea-86f3-c6e93a2679f3","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/55a6ac6f-89c7-42ea-86f3-c6e93a2679f3"},{"type":"epss","score":0.01318,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-5980"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}