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
- https://github.com/pytorch/pytorch/163122/commit/954dc5183ee9205cbe79876ad05dd2d9ae752139
- https://github.com/pytorch/pytorch/issues/163105
- https://github.com/pytorch/pytorch/releases/tag/v2.10.0
- https://github.com/pytorch/pytorch/security/advisories/GHSA-63cw-57p8-fm3p
- https://access.redhat.com/errata/RHSA-2026:24977
- https://access.redhat.com/security/cve/CVE-2026-24747
- https://bugzilla.redhat.com/show_bug.cgi?id=2433612