{"answers":{"affected":"4 open source packages ship an affected version, including pytorch-lightning and lightning. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-8019 exists.","fix":"Upgrade pytorch-lightning to 2.4.0 or later.","what":"CVE-2024-8019 is a critical vulnerability in lightning-ai/pytorch-lightning, published on 20 Mar 2025. 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-8019 and fix it if it is affected.\n\nWhat it is: CVE-2024-8019 is a critical vulnerability in lightning-ai/pytorch-lightning, published on 20 Mar 2025. 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-8019 exists.\n\nAffected packages and fixed versions:\n- pytorch-lightning (PyPI): affected all versions; fixed in 2.4.0\n- pytorch-lightning (PyPI): affected all versions; fixed in 2.4.0\n- pytorch-lightning (PyPI): affected all versions; fixed in 2.4.0\n- lightning (PyPI): affected all versions; fixed in 2.4.0\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-8019/ (Markdown: https://insights.sbomify.com/CVE-2024-8019/index.md)","id":"CVE-2024-8019","markdown":"https://insights.sbomify.com/CVE-2024-8019/index.md","name":"CVE-2024-8019","record":{"aliases":["GHSA-4cv3-v7pv-rfhf","PYSEC-2026-3970","PYSEC-2026-507"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"PyTorch Lightning library","requires_auth":"none","summary":"Attackers can write or overwrite arbitrary files via a crafted filename in the upload endpoint, potentially leading to remote code execution.","user_interaction":"not_required","vuln_class":"file_upload"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntr_ai","cpe":[{"product":"pytorch_lightning","vendor":"lightningai"}],"cvss":{"score":9.1,"severity":"critical","source":"cna","vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","version":"3.0"},"cwes":[{"id":"CWE-434","name":"Unrestricted Upload of File with Dangerous Type"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Arbitrary File Write/Overwrite in lightning-ai/pytorch-lightning","id":"CVE-2024-8019","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"file_upload","year":"2024"},"n_packages":4,"n_references":2,"next":{"headline":"Denial of Service in lightning-ai/pytorch-lightning","id":"CVE-2024-8020"},"packages":[{"ecosystem":"PyPI","fixed":["2.4.0"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"PYSEC-2026-3970"},{"ecosystem":"PyPI","fixed":["2.4.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":null,"source":"GHSA-4cv3-v7pv-rfhf"},{"ecosystem":"PyPI","fixed":["2.4.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"GHSA-4cv3-v7pv-rfhf"},{"ecosystem":"PyPI","fixed":["2.4.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"PYSEC-2026-507"}],"prev":{"headline":"Denial of Service (DOS) in imartinez/privategpt","id":"CVE-2024-8018"},"products":["lightning-ai/pytorch-lightning"],"published":"2025-03-20","related":[{"cvss_score":9.8,"headline":"RCE via Property/Class Pollution in lightning-ai/pytorch-lightning","id":"CVE-2024-5452","kev_date_added":null,"published":"2024-06-06"},{"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 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)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-03-20","vendors":["lightning-ai"]},"summary":"Attackers can write or overwrite arbitrary files via a crafted filename in the upload endpoint, potentially leading to remote code execution.","url":"https://insights.sbomify.com/CVE-2024-8019/"}