Skip to main content

Deserialization of Untrusted Data

CVE-2026-31221

Severity High
Score 9.3/10

Summary

PyTorch-Lightning versions through 2.6.0 contain an Insecure Deserialization vulnerability in the checkpoint loading mechanism. The method "LightningModule.load_from_checkpoint()" internally calls "torch.load()" without enabling the security-restrictive "weights_only=True" parameter. This behavior allows deserialization of arbitrary Python objects through the Pickle module. An attacker may exploit this issue by supplying a malicious checkpoint file, potentially resulting in arbitrary code execution when the file is loaded.

  • LOW
  • LOCAL
  • HIGH
  • UNCHANGED
  • REQUIRED
  • NONE
  • HIGH
  • HIGH

CWE-502 - Deserialization of Untrusted Data

Deserialization of untrusted data vulnerabilities enable an attacker to replace or manipulate a serialized object, replacing it with malicious data. When the object is deserialized at the victim's end the malicious data is able to compromise the victim’s system. The exploit can be devastating, its impact may range from privilege escalation, broken access control, or denial of service attacks to allowing unauthorized access to the application's internal code and logic which can compromise the entire system.

References

Advisory Timeline

  • Published