{"id":"CVE-2024-5452","kind":"vulnerability","aliases":["CVE-2024-5452","GHSA-cgwc-qvrx-rf7f"],"related":[],"title":"Remote code execution in pytorch lightning","description":"A remote code execution (RCE) vulnerability exists in the lightning-ai/pytorch-lightning library version 2.2.1 due to improper handling of deserialized user input and mismanagement of dunder attributes by the `deepdiff` library. The library uses `deepdiff.Delta` objects to modify application state based on frontend actions. However, it is possible to bypass the intended restrictions on modifying dunder attributes, allowing an attacker to construct a serialized delta that passes the deserializer whitelist and contains dunder attributes. When processed, this can be exploited to access other modules, classes, and instances, leading to arbitrary attribute write and total RCE on any self-hosted pytorch-lightning application in its default configuration, as the delta endpoint is enabled by default.","summary":"PyTorch Lightning deserializes user-supplied deepdiff Delta objects sent to a frontend endpoint, and dunder attributes can slip past its whitelist. A remote attacker can write arbitrary attributes and execute code on the server.","severity":"critical","cvss":9.8,"epss":0.26831,"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.3.3","ecosystem":"vendor"}],"ecosystems":["pypi","vendor"],"tags":["cwe-913","cwe-915","deepdiff","package","python","pytorch-lightning","self-hosted"],"not_affected_if":["delta-endpoint-disabled","offline-training-only"],"how_to_check":"- Run `pip show lightning pytorch-lightning` and compare the version against `2.3.3`\n- Look for a self-hosted Lightning app that exposes the delta endpoint, which is enabled by default","fix":"- `lightning` and `pytorch-lightning`: upgrade to `2.3.3`","status":"open","published_at":"2024-06-06T18:15:20+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","triaged_at":"2026-11-16T15:19:16+00:00","updated_at":"2026-11-16T15:37:59+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-11-16T15:19:16Z","model":"claude-haiku-5-5","output":{"fix":"- `lightning` and `pytorch-lightning`: upgrade to `2.3.3`","reach":"internet","title":"PyTorch Lightning: crafted deepdiff delta lets remote users run code","impact":"high","summary":"PyTorch Lightning deserializes user-supplied deepdiff Delta objects sent to a frontend endpoint, and dunder attributes can slip past its whitelist. A remote attacker can write arbitrary attributes and execute code on the server.","audience":"developers","category":"package","nicknames":[],"who_cares":["pytorch-lightning","python","self-hosted","deepdiff"],"confidence":0.8,"fix_status":"available","needs_auth":"no","worst_case":"Remote attacker runs code on the server hosting the app","analyst_note":"","how_to_check":"- Run `pip show lightning pytorch-lightning` and compare the version against `2.3.3`\n- Look for a self-hosted Lightning app that exposes the delta endpoint, which is enabled by default","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["offline-training-only","delta-endpoint-disabled"],"who_is_affected":"Self-hosted PyTorch Lightning applications running a version below 2.3.3 with the delta endpoint reachable from the network. The delta endpoint is enabled by default, so default configurations are exposed. Teams that only use Lightning for offline training scripts with no network-facing app can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"no","severity_if_unknown":"critical"},"cost_usd":0.000749,"input_tokens":4804,"output_tokens":538,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2024':8A,16A '-5452':9A,17A '-913':26B '-915':28B '/pytorch-lightning':85C '2.2.1':88C 'access':156C 'action':118C 'ai':84C 'allow':132C 'applic':113C,178C 'arbitrari':65B,164C 'attack':62B,134C 'attribut':54B,66B,101C,131C,148C,165C 'base':115C 'bypass':124C 'cgwc':12A 'class':159C 'code':2A,69B,75C 'configur':182C 'construct':136C 'contain':146C 'cve':7A,15A 'cwe':25B,27B 'deepdiff':29B,44B,104C 'deepdiff.delta':109C 'default':181C,190C 'delta':45B,139C,185C 'deseri':40B,94C,143C 'due':89C 'dunder':53B,100C,130C,147C 'enabl':188C 'endpoint':51B,186C 'execut':3A,68B,76C 'exist':79C 'exploit':154C 'frontend':50B,117C 'ghsa':11A 'ghsa-cgwc-qvrx-rf7f':10A 'handl':92C 'host':37B,174C 'howev':119C 'improp':91C 'input':96C 'instanc':161C 'intend':126C 'lead':162C 'librari':86C,105C,107C 'lightn':6A,34B,39B,83C,177C 'lightning':18A,21A,24A 'lightning-ai':82C 'lightningai':22A 'mismanag':98C 'modifi':112C,129C 'modul':158C 'object':46B,110C 'packag':30B 'pass':141C 'past':57B 'possibl':122C 'process':150C 'python':31B 'pytorch':5A,20A,23A,33B,38B,176C 'pytorch-lightn':32B,175C 'pytorch-lightning':19A 'qvrx':13A 'rce':77C,169C 'remot':1A,61B,74C 'restrict':127C 'rf7f':14A 'self':36B,173C 'self-host':35B,172C 'sent':47B 'serial':138C 'server':72B 'slip':56B 'state':114C 'suppli':43B 'total':168C 'use':108C 'user':42B,95C 'user-suppli':41B 'version':87C 'vulner':78C 'whitelist':59B,144C 'write':64B,166C","nicknames":[],"mitigations":[],"who_affected":"Self-hosted PyTorch Lightning applications running a version below 2.3.3 with the delta endpoint reachable from the network. The delta endpoint is enabled by default, so default configurations are exposed. Teams that only use Lightning for offline training scripts with no network-facing app can skip it.","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","cwe913","cwe915","deepdiff","package","pypi","python","pytorchlightning","selfhosted","vendor"],"campaign_type":null,"search_a":"'-2024':8A,16A '-5452':9A,17A 'cgwc':12A 'code':2A 'cve':7A,15A 'execut':3A 'ghsa':11A 'ghsa-cgwc-qvrx-rf7f':10A 'lightn':6A 'lightning':18A,21A,24A 'lightningai':22A 'pytorch':5A,20A,23A 'pytorch-lightning':19A 'qvrx':13A 'remot':1A 'rf7f':14A","search_b":"'-913':26B '-915':28B 'arbitrari':65B 'attack':62B 'attribut':54B,66B 'code':69B 'cwe':25B,27B 'deepdiff':29B,44B 'delta':45B 'deseri':40B 'dunder':53B 'endpoint':51B 'execut':68B 'frontend':50B 'host':37B 'lightn':34B,39B 'object':46B 'packag':30B 'past':57B 'python':31B 'pytorch':33B,38B 'pytorch-lightn':32B 'remot':61B 'self':36B 'self-host':35B 'sent':47B 'server':72B 'slip':56B 'suppli':43B 'user':42B 'user-suppli':41B 'whitelist':59B 'write':64B","search_c":"'/pytorch-lightning':85C '2.2.1':88C 'access':156C 'action':118C 'ai':84C 'allow':132C 'applic':113C,178C 'arbitrari':164C 'attack':134C 'attribut':101C,131C,148C,165C 'base':115C 'bypass':124C 'class':159C 'code':75C 'configur':182C 'construct':136C 'contain':146C 'deepdiff':104C 'deepdiff.delta':109C 'default':181C,190C 'delta':139C,185C 'deseri':94C,143C 'due':89C 'dunder':100C,130C,147C 'enabl':188C 'endpoint':186C 'execut':76C 'exist':79C 'exploit':154C 'frontend':117C 'handl':92C 'host':174C 'howev':119C 'improp':91C 'input':96C 'instanc':161C 'intend':126C 'lead':162C 'librari':86C,105C,107C 'lightn':83C,177C 'lightning-ai':82C 'mismanag':98C 'modifi':112C,129C 'modul':158C 'object':110C 'pass':141C 'possibl':122C 'process':150C 'pytorch':176C 'pytorch-lightn':175C 'rce':77C,169C 'remot':74C 'restrict':127C 'self':173C 'self-host':172C 'serial':138C 'state':114C 'total':168C 'use':108C 'user':95C 'version':87C 'vulner':78C 'whitelist':144C 'write':166C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2024-06-06T18:15:20+00:00","kev":null,"cvss_vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cvss_by":"GitHub","poc_count":1,"sources":[{"source":"ghsa","external_id":"GHSA-cgwc-qvrx-rf7f","url":"https://github.com/advisories/GHSA-cgwc-qvrx-rf7f","severity":"critical","published_at":"2024-06-06T18:30:58+00:00","modified_at":"2026-11-16T15:15:31+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","fetched_at":"2026-11-16T15:26:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2024-5452","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-5452","severity":null,"published_at":"2024-06-06T18:15:20+00:00","modified_at":"2026-06-17T08:15:58+00:00","first_seen_at":"2026-11-16T15:37:59+00:00","fetched_at":"2026-11-16T15:37:59+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":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":170686,"url":"https://huntr.com/bounties/486add92-275e-4a7b-92f9-42d84bc759da","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/486add92-275e-4a7b-92f9-42d84bc759da"},{"type":"epss","score":0.26831,"url":"https://api.first.org/data/v1/epss?cve=CVE-2024-5452"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}