PYSEC-2024-259
Deserialization RCE vulnerability in torch (PyPI)

Deserialization RCE No known exploit

What is PYSEC-2024-259 About?

In PyTorch versions up to 2.4.1, the RemoteModule component is susceptible to Deserialization Remote Code Execution (RCE). Although disputed as intended behavior in distributed computing, this vulnerability could allow an attacker to execute arbitrary code. Exploitation could be simple, depending on module usage.

Affected Software

torch <2.5.0

Technical Details

The vulnerability exists within the RemoteModule component of PyTorch versions <=2.4.1. This component is designed for distributed computing paradigms, which often involve the serialization and deserialization of objects, including code, across different nodes. The Deserialization RCE occurs when an attacker can supply a malicious serialized object to the RemoteModule for deserialization. Due to insufficient validation during the deserialization process, the malicious object's embedded code is executed on the target system, leading to arbitrary code execution. The dispute highlights that in some distributed computing contexts, code execution via serialization might be expected, but outside these contexts, it represents a severe security flaw.

What is the Impact of PYSEC-2024-259?

Successful exploitation may allow attackers to execute arbitrary code on the affected system, leading to full system compromise, data theft, or further network penetration.

What is the Exploitability of PYSEC-2024-259?

Exploitation requires the ability for an attacker to send or inject specially crafted serialized data to a PyTorch application that utilizes the RemoteModule for deserialization. This is typically a remote attack. Authentication requirements depend on whether the RemoteModule interface is exposed without authentication; however, in a distributed computing environment, it might assume trusted internal communication. Privilege requirements would be those associated with the process running the RemoteModule. The complexity can range from low to moderate depending on the accessibility of the RemoteModule and the ease of crafting malicious serialized data. Risk factors increase significantly in environments where RemoteModule handles data from untrusted sources or where insufficient authentication/authorization is in place for inter-process communication.

What are the Known Public Exploits?

PoC Author Link Commentary
No known exploits

What are the Available Fixes for PYSEC-2024-259?

Available Upgrade Options

  • torch
    • <2.5.0 → Upgrade to 2.5.0

Struggling with dependency upgrades?

See how Resolved Security's drop-in replacements make it simple.

Book a demo

Additional Resources

What are Similar Vulnerabilities to PYSEC-2024-259?

Similar Vulnerabilities: CVE-2023-51460 , CVE-2023-38545 , CVE-2023-28169 , CVE-2023-21966 , CVE-2021-44228