CVE-2026-136427: PyTorch AOTI Loader Runs Shell Code

A flaw in PyTorch's loader for ahead-of-time compiled models lets a crafted package run a shell command on the machine that opens it. Tracked as CVE-2026-136427, the issue is in AOTIModelPackageLoader, which handles .pt2 packages produced by the AOTInductor compiler. Such packages can ship C++ source that the loader compiles on the target machine, and the compiler command is built from JSON stored inside the package itself.
Build flags from the package reach the shell
The loader reads the compiler name, flags, include paths and passthrough arguments from the package's compile-flags file and joins them into a single shell command, which it runs with system(). A package whose compiler entry reads as a shell command carrying a payload runs that payload as soon as the model is loaded. The flaw is an operating-system command injection, scored 7.8, and it needs no privileges: the code runs with the permissions of whoever loaded the model.
Reported in July, published as a zero-day
Researcher YJK of ZUSO ART reported the flaw through the Zero Day Initiative, which passed it to PyTorch on 17 July 2026. PyTorch rejected it as expected behaviour on 23 July, and ZDI published advisory ZDI-26-1053 on 24 November after giving notice. The flaw affects PyTorch 2.12.1, and the code is unchanged in the current 2.15.0 release, so there is no fixed version. The only defence is to load compiled model packages only from sources you trust, and to run any job that touches third-party model files in a sandbox with no credentials or keys. No exploitation in the wild has been reported.