NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · PyPI

CVE-2026-24747: PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files

highCVSS 3.1 8.8GHSA-63cw-57p8-fm3p

Summary A vulnerability in PyTorch's weightsonly unpickler allows an attacker to craft a malicious checkpoint file (.pth) that, when loaded with torch.load(..., weightsonly=True), can corrupt memory and potentially lead to arbitrary code execution. Vulnerability Details The weightsonly=True unpickler failed to properly validate pickle opcodes and storage metadata, allowing: 1.

Published Jan 27, 2026 · Updated Nov 4, 2026

Affected packages

torch

Ecosystem
PyPI
Affected
< 2.10.0
Fixed in
2.10.0
Check
pip show torch

Advisory details

From the GitHub Advisory Database (CC BY 4.0).

Summary

A vulnerability in PyTorch's weights_only unpickler allows an attacker to craft a malicious checkpoint file (.pth) that, when loaded with torch.load(..., weights_only=True), can corrupt memory and potentially lead to arbitrary code execution.

Vulnerability Details

The weights_only=True unpickler failed to properly validate pickle opcodes and storage metadata, allowing:

  1. Heap memory corruption via SETITEM/SETITEMS opcodes applied to non-dictionary types
  2. Storage size mismatch between declared element count and actual data in the archive

Impact

An attacker who can convince a user to load a malicious checkpoint file may achieve arbitrary code execution in the context of the victim's process.

Credit

Ji'an Zhou

Credited to azraelxuemo, khlaifiabilel.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology

More PyPI vulnerabilities

All PyPI entries