{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": "cpe:2.3:a:lightningai:pytorch_lightning:*:*:*:*:*:python:*:*",
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "last_affected": "2.6.0"
              }
            ],
            "source": "CPE_RANGE"
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "854037098554a5fbf6ab7c66ae9617987e82911f"
            }
          ],
          "repo": "https://github.com/lightning-ai/pytorch-lightning",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "mitre",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31221.json"
  },
  "details": "PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism. The LightningModule.load_from_checkpoint() method, which is commonly used to load saved model states, internally calls torch.load() without setting the security-restrictive weights_only=True parameter. This default behavior allows the deserialization of arbitrary Python objects via the Pickle module. A remote attacker can exploit this by providing a maliciously crafted checkpoint file, leading to arbitrary code execution on the victim's system when the file is loaded.",
  "id": "CVE-2026-31221",
  "modified": "2026-07-08T05:38:01.255513133Z",
  "published": "2026-05-12T00:00:00Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://www.notion.so/CVE-2026-31221-35d1e1393188815f8db7c4fd08076639"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/31xxx/CVE-2026-31221.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-31221"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Lightning-AI/pytorch-lightning"
    }
  ],
  "schema_version": "1.7.5",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}