PyTorch: eight model-file code execution flaws, and no fix
PyTorch has eight published code execution flaws and no patch: the project treats loading untrusted model files as expected behavior.
· Zero Day Initiative · Research by YJK (ZUSO ART), Alex Williams
Zero Day Initiative published eight unpatched PyTorch advisories on November 24, each a path from a checkpoint, PT2 archive or AOTInductor package to code execution. PyTorch Foundation closed every report as expected behavior.
- zerodayinitiative.comZDI-26-1052 Advisory
- zerodayinitiative.comZDI-26-1053 Advisory
- zerodayinitiative.comZDI-26-1055 Advisory
- +2 sources
01What happened
Zero Day Initiative published eight PyTorch advisories on November 24, 2026, numbered ZDI-26-1052 to ZDI-26-1059 and carrying CVE-2026-136426 through CVE-2026-136433. YJK of ZUSO ART reported seven and Alex Williams reported one, between July and September 2026. PyTorch Foundation closed each report as expected behavior, so ZDI released all eight as 0-day advisories.
02How it works
Each flaw turns a file PyTorch reads into code that runs in the loading process. Four deserialize untrusted data, through load_compiled_function, load_state_dict_from_url, torch_save_to_dcp and the FileSystemReader class. PT2 archive parsing adds a code injection and an exposed dangerous method. AOTIModelPackageLoader adds a command injection, where a user-supplied string reaches a system call, and a directory traversal, where an unvalidated path reaches file operations.
03Who is affected
Anyone who loads a PyTorch checkpoint, state dict, PT2 archive or AOTInductor model package from a source they do not control. The advisories name no affected version range and no fixed version, so no release can be confirmed safe.
04What to do
Load checkpoints, PT2 archives and AOTInductor packages only from artifact stores you control, because no patch exists. ZDI lists restricting interaction with the product as the only mitigation.
Questions people ask
- Is there a patch for the PyTorch ZDI advisories?
- No patch exists for the eight PyTorch advisories ZDI published on November 24, 2026. Each disclosure timeline records that PyTorch Foundation rejected the report as expected behavior and closed it, and none of the advisories names a fixed version. ZDI gives one mitigation: restrict interaction with the product. Defenders should assume any PyTorch install will run code from a model file it is told to load.
- Which PyTorch functions do the advisories name?
- The eight PyTorch advisories name load_compiled_function, load_state_dict_from_url, torch_save_to_dcp, FileSystemReader, AOTIModelPackageLoader and the PT2 archive parser. Four are deserialization of untrusted data, one is code injection in PT2 parsing, one is an exposed dangerous method in PT2 parsing, one is a command injection and one is a directory traversal. All eight end in code execution in the loading process.
- Does exploiting the PyTorch flaws need user interaction?
- Yes. Every one of the eight PyTorch advisories carries UI:R in its CVSS vector, which means the target must open a malicious file or visit a malicious page. Seven score CVSS 7.8 with a local attack vector, and ZDI-26-1056 scores 7.0 with high attack complexity. In practice the required action is loading a model artifact that an attacker supplied.
- How does PyTorch's response compare with DeepSpeed's?
- PyTorch Foundation answered ZDI and rejected the reports as expected behavior, which ZDI then contested with evidence from PyTorch's own documentation. For the five DeepSpeed advisories published the same day, ZDI's timelines record no maintainer reply at all across four requests. Neither project has a published fix, so the practical control in both cases is to restrict which artifacts get loaded.
Sources 5 links, all fetched
- 1zerodayinitiative.comZDI-26-1052 Advisory
- 2zerodayinitiative.comZDI-26-1053 Advisory
- 3zerodayinitiative.comZDI-26-1055 Advisory
- 4zerodayinitiative.comZDI-26-1057 Advisory
- 5zerodayinitiative.comZDI-26-1059 Advisory