CVE-2024-48063 Overview
CVE-2024-48063 is an insecure deserialization vulnerability affecting PyTorch versions 2.4.1 and earlier. The vulnerability exists within the RemoteModule component of PyTorch's distributed RPC framework, which can be exploited to achieve remote code execution (RCE) through malicious deserialization of untrusted data. It is important to note that this vulnerability is disputed by multiple parties, as the behavior is considered intended functionality within PyTorch's distributed computing architecture.
Critical Impact
Successful exploitation allows unauthenticated attackers to execute arbitrary code remotely on systems running vulnerable PyTorch distributed computing environments, potentially leading to complete system compromise.
Affected Products
- Linux Foundation PyTorch versions up to and including 2.4.1
- PyTorch distributed RPC framework implementations
- Systems utilizing RemoteModule for distributed machine learning workloads
Discovery Timeline
- 2024-10-29 - CVE-2024-48063 published to NVD
- 2025-07-16 - Last updated in NVD database
Technical Details for CVE-2024-48063
Vulnerability Analysis
The vulnerability resides in PyTorch's distributed RPC framework, specifically within the RemoteModule class used for distributed machine learning operations. The RemoteModule enables remote execution of neural network modules across distributed systems, but the underlying serialization mechanism does not adequately validate incoming data before deserialization.
When PyTorch processes serialized objects through the distributed RPC framework, it relies on Python's pickle serialization mechanism. This approach is inherently dangerous when handling untrusted input, as pickle can execute arbitrary Python code during the deserialization process. An attacker with network access to a PyTorch RPC endpoint can craft malicious serialized payloads that execute arbitrary commands when processed by the target system.
The dispute surrounding this vulnerability stems from PyTorch's documented security model, which explicitly states that distributed features are designed for trusted environments and should not be exposed to untrusted networks. According to PyTorch's security policy, the distributed RPC framework assumes all participating nodes are trusted, and using these features in untrusted environments is outside the intended security boundary.
Root Cause
The root cause is the use of Python's pickle serialization for object serialization in the RemoteModule implementation. Pickle is known to be unsafe for deserializing untrusted data, as it can instantiate arbitrary Python objects and execute code during the deserialization process. The RemoteModule component does not implement additional validation or sandboxing to prevent malicious code execution from crafted payloads.
Attack Vector
The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by:
- Identifying a PyTorch RPC endpoint exposed to the network
- Crafting a malicious serialized payload containing arbitrary Python code
- Sending the payload to the target endpoint using the RPC protocol
- The target system deserializes the payload, executing the embedded malicious code
The vulnerability is exploitable via the RemoteModule interface, which handles distributed neural network module execution. Technical details and proof-of-concept demonstrations are available in the referenced external resources, including a GitHub Gist containing PoC code and a detailed RCE analysis on Notion.
Detection Methods for CVE-2024-48063
Indicators of Compromise
- Unexpected network connections to PyTorch RPC ports from external or untrusted IP addresses
- Anomalous process spawning from Python processes running PyTorch distributed workloads
- Unusual file system modifications or data exfiltration attempts originating from machine learning infrastructure
- Network traffic containing suspicious serialized Python objects targeting RPC endpoints
Detection Strategies
- Monitor network traffic for connections to PyTorch distributed RPC ports from unauthorized sources
- Implement endpoint detection rules for suspicious process chains originating from Python/PyTorch processes
- Deploy network intrusion detection signatures for pickle deserialization exploitation patterns
- Audit PyTorch distributed computing configurations to identify exposed endpoints
Monitoring Recommendations
- Enable verbose logging for PyTorch distributed RPC framework components
- Monitor system calls from PyTorch processes for unauthorized command execution
- Implement network segmentation monitoring to detect lateral movement from ML infrastructure
- Establish baseline behavior for distributed ML workloads to detect anomalous activity
How to Mitigate CVE-2024-48063
Immediate Actions Required
- Audit all PyTorch distributed computing deployments to identify exposed RPC endpoints
- Ensure PyTorch RPC endpoints are not accessible from untrusted networks
- Implement network segmentation to isolate distributed ML infrastructure
- Review and restrict access to systems running PyTorch distributed workloads
Patch Information
As this vulnerability is disputed and considered intended behavior by PyTorch maintainers, there is no specific security patch available. The PyTorch security policy explicitly documents that distributed features are designed for trusted computing environments. Organizations should review the PyTorch Security Policy regarding distributed features for official guidance. Additional context can be found in GitHub Issue #129228.
Workarounds
- Restrict PyTorch RPC endpoints to trusted internal networks only using firewall rules
- Implement network-level authentication and encryption (VPN, mTLS) for distributed ML communications
- Use network segmentation to prevent untrusted systems from reaching ML infrastructure
- Consider alternative secure communication mechanisms for distributed computing if exposure to untrusted networks is required
# Example: Restrict PyTorch RPC port access using iptables
# Allow only trusted internal network (adjust IP range as needed)
iptables -A INPUT -p tcp --dport 29500 -s 10.0.0.0/8 -j ACCEPT
iptables -A INPUT -p tcp --dport 29500 -j DROP
# Verify PyTorch RPC is not exposed externally
netstat -tlnp | grep python
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

