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

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

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.

Technologies: torch (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-24747 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-24747 being exploited in the wild.
How severe is CVE-2026-24747?
High severity, with a CVSS score of 8.8, published 27 January 2026.
Which products and versions are affected?
pytorch (PyPI) ECOSYSTEM:introduced=0,fixed=2.10.0; torch (PyPI) < 2.10.0, ECOSYSTEM:introduced=0,fixed=2.10.0.
Is there a fix for CVE-2026-24747?
Yes. pytorch (PyPI): upgrade to 2.10.0 or later; torch (PyPI): upgrade to 2.10.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-24747 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-24747?
Check whether you run pytorch (PyPI) or torch (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pytorch (PyPI): upgrade to 2.10.0 or later
    pip install "pytorch>=2.10.0"
  • torch (PyPI): upgrade to 2.10.0 or later
    pip install "torch>=2.10.0"

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

Identifiers

  • CVE-2026-24747
  • GHSA-63cw-57p8-fm3p
  • PYSEC-2026-1856
  • PYSEC-2026-2286

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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.