CVE-2026-136426 in PyTorchinfo

Summary

by MITRE • 11/24/2026

PyTorch Foundation PyTorch PT2 File Parsing Code 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 parsing of PT2 files. The issue results from the lack of proper validation of a user-supplied string before using it to execute Python code. An attacker can leverage this vulnerability to execute code in the context of the current process. Was ZDI-CAN-32602.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 11/25/2026

The PyTorch Foundation has identified and addressed a critical security flaw within its PT2 file parsing mechanism that enables remote code execution through crafted input files. This vulnerability, tracked as CVE ID associated with Zero Day Initiative report ZDI-CAN-32602, stems from an insufficient validation of user-supplied strings during the processing of PyTorch version 2 model or script files. The core technical deficiency lies in the interpreter's handling of serialized data structures where specific string inputs are directly evaluated as Python code without adequate sanitization or sandboxing. This architectural oversight allows malicious actors to inject arbitrary commands that bypass standard security controls, effectively turning a routine file loading operation into a vector for full system compromise.

From a technical perspective, this flaw represents a classic instance of insecure deserialization combined with command injection principles. When an application parses external files, it must strictly validate the structure and content against expected schemas to prevent unexpected code execution. In this case, the lack of rigorous type checking and context isolation means that any string embedded within the PT2 file format is treated as executable Python bytecode or script logic by the underlying runtime environment. This behavior violates fundamental secure coding practices regarding input validation, specifically failing to enforce a whitelist approach for acceptable inputs while rejecting all others. The vulnerability aligns closely with CWE-94 Improper Control of Generation of Code and CWE-502 Deserialization of Untrusted Data, highlighting the severe risks associated with trusting external data sources without comprehensive verification mechanisms.

The operational impact of this vulnerability is profound due to its potential for remote code execution in the context of the current process. If a developer or automated system loads a maliciously crafted PT2 file using standard PyTorch APIs, the injected Python code will execute with the same privileges as the application running PyTorch. This can lead to complete compromise of the host environment, including data exfiltration, installation of backdoors, lateral movement within internal networks, and disruption of machine learning pipelines that rely on these models for inference or training tasks. Attackers do not necessarily need direct network access if they can trick users into opening malicious files via phishing or compromised model repositories, making this a high-risk threat in collaborative AI development environments where shared datasets are common.

Mitigation strategies must focus on immediate patching and enhanced input validation practices. Organizations utilizing PyTorch should update to the latest stable release that includes fixes for ZDI-CAN-32602 as soon as possible. In addition to software updates, developers implementing custom parsers or extending PT2 functionality should implement strict schema validation before processing any serialized data. It is advisable to isolate untrusted model loading operations using containerization technologies such as Docker or sandboxed environments with restricted permissions to limit the blast radius of potential exploits. Furthermore, integrating static analysis tools and dynamic testing frameworks that specifically check for insecure deserialization patterns can help identify similar vulnerabilities in custom implementations before they reach production systems.

This incident underscores the importance of adhering to industry standards like MITRE ATT&CK technique T1059 Command and Scripting Interpreter when designing secure AI infrastructure components. Security teams should treat model files with the same level of scrutiny as executable binaries, ensuring that only trusted sources are used for loading pre-trained models or scripts. Regular security audits focusing on data ingestion pipelines in machine learning workflows will further reduce exposure to such injection-based attacks. By combining timely patching with robust architectural safeguards and continuous monitoring, organizations can significantly mitigate the risk posed by this class of vulnerabilities within their deep learning ecosystems.

Responsible

Zdi

Reservation

11/24/2026

Disclosure

11/24/2026

Moderation

accepted

CPE

ready

EPSS

0.00455

KEV

no

Activities

very low

Sources

Do you know our Splunk app?

Download it now for free!