Vulnerabilities

Vulnerability · CVE-2026-31221

PyTorch-Lightning versions 2.6.0 and earlier contain an insecure deserialization vulnerability (CWE-502) in the checkpoint loading mechanism.

Published May 12, 2026 · catalog updated Jun 17, 2026 · pytorch lightning

Check if you run it

No confirmed exploitation is on record for CVE-2026-31221. EPSS is 0.55%. Act only if a listed version of pytorch lightning is installed.

Gaps on this record

  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High7.8
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.55%
Remediation
Version ranges on file
Affected products
cpe lightningai/pytorch lightning · stated pytorch lightning

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.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • cpe lightningai/pytorch lightningversion unspecified
  • stated pytorch lightning<= 2.6.0

How to fix CVE-2026-31221

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-31221. EPSS is 0.55%. Act only if a listed version of pytorch lightning is installed.

Which versions are affected?

Compare what you have installed with pytorch lightning <= 2.6.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-502: Deserialization of Untrusted Data. EPSS 0.55%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. May 12, 2026 · NIST NVD

    Detected

    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 arbi

  2. Jun 17, 2026 · NIST NVD

    Updated

    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 arbi

Sources

  • CVE.orgVulnerability recordCVE-2026-31221

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-31221

    30-day exploitation probability 0.6%

    first.org
  • NIST NVDVulnerability recordCVE-2026-31221

    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() withou

    nvd.nist.gov

References

Freshness

Last verified in this catalog Oct 18, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.