# PyTorch Lightning allows arbitrary code execution through checkpoint \_instantiator hyperparameters

Advisory record · `GHSA-qqmf-gpg7-g8gw`

- **Identifiers:** `GHSA-qqmf-gpg7-g8gw` · `CVE-2026-58659` · `PYSEC-2026-3624` · `PYSEC-2026-3967`
- **State:** Confirmed
- **Severity:** CVSS 8.4 High
- **Critical:** No
- **Weakness (CWE):** [CWE-470](https://cwe.mitre.org/data/definitions/470.html)
- **Tags:** [Code injection](https://agentprime.io/advisories/tag/code-injection.md)
- **Published:** 15 Jul 2026
- **Updated:** 24 Sept 2026
- **Reviewed by a person:** No

Published by the GitHub Advisory Database at 15 Jul 2026, 18:31 UTC. agentprime has not analysed this yet, so whether it affects any app is not known.

## Affected packages

- `lightning` (PyPI): affected `<2.6.6`; fixed in `2.6.6`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> PyTorch Lightning (lightning package) versions before 2.6.6 are vulnerable. An attacker who can supply a malicious checkpoint file can cause arbitrary code to run when it is loaded with LightningModule.load_from_checkpoint, even with weights_only=True set. Upgrade to lightning 2.6.6 or later. The source gives few details on workarounds.

Written 1 Nov 2026.

## Not analysed yet

We haven’t published our analysis of this Advisory yet. Once a person has reviewed it, this page will say what’s vulnerable, what has to be true for your app to be affected, and how to check.

## Severity and exploitation

- 8.4 High, CVSS 4.0: `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`, from CNA (VulnCheck)

- **CISA KEV:** Not listed.
- **EPSS:** 0.0063, the 50th percentile, on 13 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 15 Jul 2026, 17:02 UTC: [Confirmed by the CVE List](https://www.cve.org/CVERecord?id=CVE-2026-58659)
- 31 Oct 2026, 14:09 UTC: First seen by agentprime
- 31 Oct 2026, 14:09 UTC: [Confirmed by OSV](https://osv.dev/vulnerability/GHSA-qqmf-gpg7-g8gw)

## Sources

- [GitHub Advisory Database: GHSA-qqmf-gpg7-g8gw](https://github.com/advisories/GHSA-qqmf-gpg7-g8gw)
- [OSV: GHSA-qqmf-gpg7-g8gw](https://osv.dev/vulnerability/GHSA-qqmf-gpg7-g8gw)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-58659>
- <https://github.com/Lightning-AI/pytorch-lightning/issues/21822>
- <https://github.com/Lightning-AI/pytorch-lightning/pull/21832>
- <https://github.com/Lightning-AI/pytorch-lightning/commit/d710d689510d50e800f53b3cd773cbca20b1f86f>
- <https://github.com/Lightning-AI/pytorch-lightning>
- <https://github.com/Lightning-AI/pytorch-lightning/releases/tag/2.6.6>
- <https://github.com/advisories/GHSA-qqmf-gpg7-g8gw>
- <https://github.com/pypa/advisory-database/tree/main/vulns/lightning/PYSEC-2026-3624.yaml>
- <https://github.com/pypa/advisory-database/tree/main/vulns/pytorch-lightning/PYSEC-2026-3967.yaml>
- <https://www.vulncheck.com/advisories/pytorch-lightning-arbitrary-code-execution-via-instantiator-hyperparameter>

Facts on this page come from the GitHub Advisory Database (CC-BY 4.0), OSV and the other sources listed, as published. We don’t reproduce full advisory descriptions, which can contain exploit code.

## Check whether this affects you

A Match means an installed version is in the affected range above. Most don’t affect the app; agentprime hasn’t analysed this one yet.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), ask your agent to check the project: `check_lockfile` sends a lockfile, `check_packages` a list of installed packages, and both return the Matches and the upgrades that clear them. `get_advisory` returns this record. Setup: <https://agentprime.io/mcp.md>
- In a browser: <https://agentprime.io/check/> reads your lockfile in the browser, never uploading it.
- Whether it touches your code, with file and line: the Claude Code plugin, <https://agentprime.io/plugin.md>
- As JSON: <https://api.agentprime.io/v1/advisories/GHSA-qqmf-gpg7-g8gw>, or `POST https://api.agentprime.io/v1/match` with your packages (<https://agentprime.io/api.md>)

---

The web page: <https://agentprime.io/advisories/GHSA-qqmf-gpg7-g8gw/>. Everything for agents: <https://agentprime.io/llms.txt>.
