{"answers":{"affected":"4 open source packages ship an affected version, including lightning and pytorch-lightning. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5452 exists.","fix":"Upgrade lightning to 2.3.3 or later.","what":"CVE-2024-5452 is a critical unsafe deserialization vulnerability in lightning-ai/pytorch-lightning, published on 6 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-5452 and fix it if it is affected.\n\nWhat it is: CVE-2024-5452 is a critical unsafe deserialization vulnerability in lightning-ai/pytorch-lightning, published on 6 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5452 exists.\n\nAffected packages and fixed versions:\n- lightning (PyPI): affected all versions; fixed in 2.3.3\n- lightning (PyPI): affected all versions; fixed in 2.3.3\n- lightning (PyPI): affected all versions; fixed in 2.3.3\n- pytorch-lightning (PyPI): affected all versions; fixed in 2.3.3\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-5452/ (Markdown: https://insights.sbomify.com/CVE-2024-5452/index.md)","id":"CVE-2024-5452","markdown":"https://insights.sbomify.com/CVE-2024-5452/index.md","name":"CVE-2024-5452","record":{"aliases":["GHSA-cgwc-qvrx-rf7f","PYSEC-2026-385","PYSEC-2026-3974"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"PyTorch Lightning library","requires_auth":"none","summary":"Attackers can achieve remote code execution on self-hosted PyTorch Lightning applications by exploiting deserialization flaws in the default delta endpoint.","user_interaction":"not_required","vuln_class":"deserialization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[{"product":"pytorch_lightning","vendor":"lightningai"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.0"},"cwes":[{"id":"CWE-913","name":"Improper Control of Dynamically-Managed Code Resources"},{"id":"CWE-915","name":"Improperly Controlled Modification of Dynamically-Determined Object Attributes"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":"2025-02-09","github_poc":1,"max_poc_stars":0,"metasploit":0,"nuclei":0,"refs":[{"date":"2025-02-09T00:14:52Z","kind":"github_poc","ref":"https://github.com/skrkcb2/CVE-2024-5452","stars":0,"title":null}],"tier":"weaponised"},"has_fix":true,"headline":"RCE via Property/Class Pollution in lightning-ai/pytorch-lightning","id":"CVE-2024-5452","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"deserialization","year":"2024"},"n_packages":4,"n_references":2,"next":{"headline":"ProfileGrid \u003c= 5.8.6 - Missing Authorization","id":"CVE-2024-5453"},"packages":[{"ecosystem":"PyPI","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":null,"source":"GHSA-cgwc-qvrx-rf7f"},{"ecosystem":"PyPI","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"GHSA-cgwc-qvrx-rf7f"},{"ecosystem":"PyPI","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"PYSEC-2026-385"},{"ecosystem":"PyPI","fixed":["2.3.3"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"PYSEC-2026-3974"}],"prev":{"headline":"Cross-site scripting in The7 — Website and eCommerce Builder for WordPress","id":"CVE-2024-5451"},"products":["lightning-ai/pytorch-lightning"],"published":"2024-06-06","related":[{"cvss_score":9.3,"headline":"Compromise of PyTorch Lightning PyPi Package Versions","id":"CVE-2026-44484","kev_date_added":null,"published":"2026-05-14"},{"cvss_score":9.1,"headline":"Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning","id":"CVE-2024-8019","kev_date_added":null,"published":"2025-03-20"},{"cvss_score":9.1,"headline":"Arbitrary File Write via /v1/runs API endpoint in lightning-ai/pytorch-lightning","id":"CVE-2024-5980","kev_date_added":null,"published":"2024-06-27"},{"cvss_score":8.8,"headline":"PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization","id":"CVE-2026-31221","kev_date_added":null,"published":"2026-05-12"},{"cvss_score":8.4,"headline":"PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter","id":"CVE-2026-58659","kev_date_added":null,"published":"2026-07-15"},{"cvss_score":7.8,"headline":"Deserialization of Untrusted Data in pytorchlightning/pytorch-lightning","id":"CVE-2021-4118","kev_date_added":null,"published":"2021-12-23"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-10-15","vendors":["lightning-ai"]},"summary":"Attackers can achieve remote code execution on self-hosted PyTorch Lightning applications by exploiting deserialization flaws in the default delta endpoint.","url":"https://insights.sbomify.com/CVE-2024-5452/"}