{"answers":{"affected":"4 open source packages ship an affected version, including pytorch-lightning and lightning. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-0845 in the wild and no public exploit code.","fix":"Upgrade pytorch-lightning to 1.6.0 or later.","what":"CVE-2022-0845 is a high-severity code injection vulnerability in pytorchlightning/pytorch-lightning, published on 5 Mar 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-0845 and fix it if it is affected.\n\nWhat it is: CVE-2022-0845 is a high-severity code injection vulnerability in pytorchlightning/pytorch-lightning, published on 5 Mar 2022. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2022-0845 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pytorch-lightning (PyPI): affected all versions; fixed in 1.6.0\n- pytorch-lightning (PyPI): affected all versions; fixed in 1.6.0\n- pytorch-lightning (PyPI): affected all versions; fixed in 1.6.0\n- lightning (PyPI): affected all versions; fixed in 1.6.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-2022-0845/ (Markdown: https://insights.sbomify.com/CVE-2022-0845/index.md)","id":"CVE-2022-0845","markdown":"https://insights.sbomify.com/CVE-2022-0845/index.md","name":"CVE-2022-0845","record":{"aliases":["GHSA-r5qj-cvf9-p85h","PYSEC-2022-181","PYSEC-2026-3969"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"PyTorch Lightning library","requires_auth":"none","summary":"Attackers can execute arbitrary code via injection in PyTorch Lightning, requiring an upgrade to the latest version.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"@huntrdev","cpe":[{"product":"pytorch_lightning","vendor":"lightningai"}],"cvss":{"score":7.3,"severity":"high","source":"cna","vector":"CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:L","version":"3.0"},"cwes":[{"id":"CWE-94","name":"Improper Control of Generation of Code"}],"description":"Code Injection in GitHub repository pytorchlightning/pytorch-lightning prior to 1.6.0.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Code Injection in pytorchlightning/pytorch-lightning","id":"CVE-2022-0845","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2022"},"n_packages":4,"n_references":2,"next":{"headline":"SpeakOut! Email Petitions \u003c 2.14.15.1 - Unauthenticated SQLi","id":"CVE-2022-0846"},"packages":[{"ecosystem":"PyPI","fixed":["1.6.0"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"PYSEC-2026-3969"},{"ecosystem":"PyPI","fixed":["1.6.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":null,"source":"GHSA-r5qj-cvf9-p85h"},{"ecosystem":"PyPI","fixed":["1.6.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"GHSA-r5qj-cvf9-p85h"},{"ecosystem":"PyPI","fixed":["1.6.0"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"PYSEC-2022-181"}],"prev":{"headline":"DO NOT USE THIS CANDIDATE NUMBER.","id":"CVE-2022-0844"},"products":["pytorchlightning/pytorch-lightning"],"published":"2022-03-05","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/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)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-02","vendors":["pytorchlightning"]},"summary":"Attackers can execute arbitrary code via injection in PyTorch Lightning, requiring an upgrade to the latest version.","url":"https://insights.sbomify.com/CVE-2022-0845/"}