CVE-2026-136427 in PyTorchinfo

Summary

by MITRE • 11/24/2026

PyTorch Foundation PyTorch AOTIModelPackageLoader Command Injection Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of PyTorch. Interaction with this library is required to exploit this vulnerability but attack vectors may vary depending on the implementation.

The specific flaw exists within the AOTIModelPackageLoader. The issue results from the lack of proper validation of a user-supplied string before using it to execute a system call. An attacker can leverage this vulnerability to execute code in the context of the current user. Was ZDI-CAN-32262.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The PyTorch Foundation has addressed a critical security flaw within its AOTIModelPackageLoader component, identified under ZDI-CAN-32262. This vulnerability represents a significant risk to systems utilizing the Ahead-of-Time Inference engine for machine learning model deployment. The core of the issue lies in how the library handles input data during the loading and initialization phases of an AI model package. Specifically, the AOTIModelPackageLoader fails to adequately sanitize or validate user-supplied strings before passing them into underlying system calls. This architectural oversight creates a pathway for command injection attacks, allowing malicious actors to bypass intended security boundaries within the application environment.

From a technical perspective, this flaw is classified as CWE-78 Improper Neutralization of Special Elements used in an OS Command commonly known as OS Command Injection. The vulnerability arises because the loader accepts external input that directly influences the construction of operating system commands without applying rigorous filtering or escaping mechanisms. When the application processes these unvalidated strings, it inadvertently executes them with the privileges of the user running the PyTorch process. This lack of separation between data and code execution context is a fundamental design error in secure software development practices. The attacker does not need to interact directly with the operating system shell; instead, they exploit the trusted application logic to perform the injection, which often bypasses perimeter security controls that do not inspect internal application behavior.

The operational impact of this vulnerability is severe due to its potential for Remote Code Execution. Although interaction with the PyTorch library is required to trigger the flaw, many production environments expose model loading interfaces via network services or APIs. If an attacker can supply a maliciously crafted model package path or configuration string through such an interface, they can achieve arbitrary code execution on the host system. This grants them full control over the underlying operating environment, potentially leading to data exfiltration, lateral movement within the network, or complete compromise of the infrastructure hosting the machine learning workloads. The severity is further amplified by the fact that AI/ML services often run with elevated privileges to access hardware accelerators like GPUs, thereby increasing the blast radius of a successful exploitation attempt.

This vulnerability aligns with several tactics in the MITRE ATT&CK framework, particularly T1059 Command and Scripting Interpreter for execution techniques and potentially T1203 Exploitation for Client Execution if delivered via malicious model files. The attack vector relies on tricking the application into executing system-level commands under the guise of normal model loading operations. Defense in depth strategies are essential here, as relying solely on input validation is often insufficient against sophisticated attackers who may employ obfuscation techniques to evade basic detection rules.

To mitigate this risk, organizations must immediately apply the latest patches provided by the PyTorch Foundation that address the AOTIModelPackageLoader validation logic. It is critical to ensure that all instances of PyTorch in production environments are updated to versions where this specific command injection flaw has been resolved. Additionally, developers should implement strict input validation policies for any data passed to model loading functions, ensuring that only expected and safe characters or paths are accepted. Running AI inference services with the principle of least privilege is also recommended; by restricting the permissions of the user account executing PyTorch processes, the potential impact of a successful command injection can be significantly reduced even if other security controls fail. Regular auditing of third-party library dependencies and continuous monitoring for anomalous system call patterns originating from ML workloads will further enhance resilience against such vulnerabilities.

Responsible

Zdi

Reservation

11/24/2026

Disclosure

11/24/2026

Moderation

accepted

CPE

ready

EPSS

0.00651

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!