Advisory

PYSEC-2026-3972

Also known as: CVE-2026-31221, GHSA-75m9-98v2-hjpm, PYSEC-2026-3043

Summary

PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization

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.

Severity

High Basis: CVSS v3 score 7.8, vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Dates

Published
2026-09-10 16:42 UTC
Modified
2026-09-10 17:25 UTC

Affected packages and fixes

lightning

PyPI · All systems

Affected

  • introduced 0, last affected 2.6.0 (ecosystem)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: PyPA Advisory Database · CC BY 4.0

Sources & licences