{"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-2026-58659 exists.","fix":"Upgrade pytorch-lightning to 2.6.6 or later.","what":"CVE-2026-58659 is a high-severity code injection vulnerability in Lightning-AI pytorch-lightning, published on 15 Jul 2026. 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-2026-58659 and fix it if it is affected.\n\nWhat it is: CVE-2026-58659 is a high-severity code injection vulnerability in Lightning-AI pytorch-lightning, published on 15 Jul 2026. 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: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-58659 exists.\n\nAffected packages and fixed versions:\n- pytorch-lightning (PyPI): affected all versions; fixed in 2.6.6\n- lightning (PyPI): affected all versions; fixed in 2.6.6\n- lightning (PyPI): affected all versions; fixed in 2.6.6\n- lightning (PyPI): affected all versions; fixed in 2.6.6\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-2026-58659/ (Markdown: https://insights.sbomify.com/CVE-2026-58659/index.md)","id":"CVE-2026-58659","markdown":"https://insights.sbomify.com/CVE-2026-58659/index.md","name":"CVE-2026-58659","record":{"aliases":["GHSA-qqmf-gpg7-g8gw","PYSEC-2026-3624","PYSEC-2026-3967"],"analysis":{"component_type":"library","fix_type":"patch","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 by crafting malicious checkpoint files that bypass security protections in PyTorch Lightning.","user_interaction":"required","vuln_class":"code_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"VulnCheck","cpe":[{"product":"pytorch_lightning","vendor":"lightningai"}],"cvss":{"score":8.4,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-470","name":"Use of Externally-Controlled Input to Select Classes or Code"}],"description":"PyTorch Lightning through 2.6.5, fixed in commit d710d68, contains a remote code execution vulnerability in the _load_state function that imports and executes attacker-controlled module names from checkpoint _instantiator hyperparameters. Attackers can craft malicious checkpoint files that bypass weights_only=True protections to execute arbitrary code when LightningModule.load_from_checkpoint is called.","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":"PyTorch Lightning Arbitrary Code Execution via _instantiator Hyperparameter","id":"CVE-2026-58659","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"code_injection","year":"2026"},"n_packages":4,"n_references":4,"next":{"headline":"Kanboard BoardAjaxController Missing Ownership Check via Drag-and-Drop","id":"CVE-2026-58660"},"packages":[{"ecosystem":"PyPI","fixed":["2.6.6"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":null,"source":"GHSA-qqmf-gpg7-g8gw"},{"ecosystem":"PyPI","fixed":["2.6.6"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"GHSA-qqmf-gpg7-g8gw"},{"ecosystem":"PyPI","fixed":["2.6.6"],"introduced":["0"],"last_affected":[],"package":"lightning","purl":"pkg:pypi/lightning","source":"PYSEC-2026-3624"},{"ecosystem":"PyPI","fixed":["2.6.6"],"introduced":["0"],"last_affected":[],"package":"pytorch-lightning","purl":"pkg:pypi/pytorch-lightning","source":"PYSEC-2026-3967"}],"prev":{"headline":"GPUStack Unauthenticated Information Disclosure via Worker Endpoints","id":"CVE-2026-58658"},"products":["pytorch-lightning"],"published":"2026-07-15","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":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":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2026-10-08","vendors":["Lightning-AI"]},"summary":"Attackers can execute arbitrary code by crafting malicious checkpoint files that bypass security protections in PyTorch Lightning.","url":"https://insights.sbomify.com/CVE-2026-58659/"}