Skip to content
OpenAdvisories
High · 8.8 CVE-2026-31221 EUVD-2026-29505GHSA-75m9-98v2-hjpmPYSEC-2026-3043PYSEC-2026-3972

PyTorch Lightning load_from_checkpoint has an insecure checkpoint deserialization

Published May 12, 2026 · Updated May 15, 2026 · Assigned by mitre

Description

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.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Ubuntu 26.10 pytorch No fix yet —
Ubuntu 26.04 LTS pytorch No fix yet —
Ubuntu 25.10 pytorch No fix yet —
Ubuntu 22.04 LTS pytorch No fix yet —

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI lightning <= 2.6.0 — PYSEC-2026-3972
PyPI pytorch-lightning <= 2.6.0 — GHSA-75m9-98v2-hjpm

References