Junglewise Threat Intelligence

CVE-2026-24747: PyTorch arbitrary code execution in weights_only unpickler

CVE-2026-24747 · Severity: high · CVSS 8.8 · Published 2026-01-27

Technologies: torch (PyPI), PyTorch Foundation PyTorch. Vendors: PyPI, Red Hat.

Executive brief

PyTorch is a widely used software library for building and training artificial intelligence models. A security flaw was found in how it handles saved model files, even when using a 'safe' loading mode. If a user is tricked into opening a malicious model file, an attacker could take control of the computer running the software, potentially leading to data theft or system compromise.

Technical details

A vulnerability exists in PyTorch's 'weights_only' unpickler (used during torch.load) due to improper validation of pickle opcodes and storage metadata. Specifically, the unpickler fails to restrict SETITEM and SETITEMS opcodes, which can be applied to non-dictionary types to cause heap memory corruption. Additionally, it does not properly validate the element count against actual data in the archive. An attacker can exploit this by crafting a malicious .pth checkpoint file that, when loaded by a victim, triggers memory corruption and potentially arbitrary code execution. This issue is fixed in PyTorch version 2.10.0.

Affected products

  • PyTorch Foundation PyTorch < 2.10.0
  • Red Hat OpenShift AI 2.25 2.25.7

Timeline

  • 2026-01-21: patched: PyTorch version 2.10.0 released.
  • 2026-01-26: advisory: GitHub Security Advisory GHSA-63cw-57p8-fm3p published.
  • 2026-01-27: disclosed: CVE-2026-24747 published to NVD.
  • 2026-06-10: patched: Red Hat released updates for OpenShift AI.

References

Related threats