PyTorch Foundation PyTorch PT2 Vulnerable to Remote Code Execution via File Parsing Flaw
A critical remote code execution vulnerability (ZDI-26-1056) has been discovered in PyTorch Foundation's PyTorch PT2, stemming from dangerous file parsing methods.

A critical remote code execution vulnerability, designated ZDI-26-1056, has been identified in PyTorch Foundation's PyTorch PT2 software. This flaw, which carries a CVSS score of 7.0, allows attackers to execute arbitrary code on vulnerable systems. Exploitation of this vulnerability requires user interaction, specifically by tricking a user into opening a malicious file.
The vulnerability resides within the parsing of PT2 archive files. The root cause is an exposed dangerous function that, when triggered by a specially crafted file, enables an attacker to execute code within the context of the current process. This means that the attacker's code would run with the same permissions as the PyTorch process itself.
Details of the vulnerability were submitted to the vendor on August 1, 2026. However, the vendor initially rejected the report, considering the behavior expected and closing the advisory. Following a reply from the Zero Day Initiative (ZDI) on August 27, 2026, which provided evidence from the product's documentation, ZDI notified the vendor of their intention to publish the case as a zero-day advisory on November 3, 2026.
The coordinated public release of the advisory occurred on November 24, 2026, marking the official disclosure of the vulnerability. The advisory was also updated on the same day. The vulnerability was discovered by YJK, who is affiliated with ZUSO ART.
Given the nature of this vulnerability, which relies on user interaction through opening a malicious file, the primary mitigation strategy recommended is to restrict interaction with the product. Users should exercise extreme caution and avoid opening files from untrusted sources or unexpected origins.
This vulnerability highlights a common attack vector where parsing of complex file formats can lead to security weaknesses. Many software applications, especially those dealing with data serialization or complex file structures, are susceptible to such flaws if input validation and sanitization are not rigorously implemented.
While PyTorch is a widely used framework for machine learning and deep learning, this specific vulnerability affects its PT2 archive file parsing. Developers and users of PyTorch PT2 should be aware of this risk and follow security best practices to protect their systems. The timeline indicates a challenging vendor response, underscoring the importance of independent security research and disclosure processes.
Further technical details regarding the specific dangerous function and the exact method of exploitation are expected to be elaborated upon in subsequent security analyses. For now, the focus remains on user awareness and the avoidance of potentially malicious files to prevent compromise.
This advisory, ZDI-26-1052, details a remote code execution vulnerability within PyTorch Foundation's PyTorch library, specifically concerning the parsing of PT2 files. The flaw arises from inadequate validation of user-supplied strings, enabling attackers to execute arbitrary Python code within the context of the affected process. The Zero Day Initiative reported the vulnerability on July 17, 2026, but the vendor initially rejected it as expected behavior before ZDI provided further evidence, leading to a public disclosure on November 24, 2026.