CVE-2024-48063
📋 TL;DR
This vulnerability allows remote code execution through deserialization in PyTorch's RemoteModule feature. It affects users running PyTorch distributed computing with RemoteModule enabled. The vulnerability is disputed as intended behavior for distributed computing functionality.
💻 Affected Systems
- PyTorch
📦 What is this software?
Pytorch by Linuxfoundation
⚠️ Risk & Real-World Impact
Worst Case
Full system compromise allowing attacker to execute arbitrary code with the privileges of the PyTorch process, potentially leading to data theft, system takeover, or lateral movement.
Likely Case
Limited impact in controlled environments where RemoteModule is used only between trusted nodes, but could lead to RCE if untrusted nodes are allowed to connect.
If Mitigated
Minimal impact when proper network segmentation and authentication controls are implemented between distributed nodes.
🎯 Exploit Status
Exploitation requires network access to the RemoteModule endpoint. The vulnerability is disputed as intended behavior for distributed computing where nodes must be trusted.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: N/A
Vendor Advisory: https://github.com/pytorch/pytorch/security/policy#using-distributed-features
Restart Required: No
Instructions:
No official patch as this is disputed behavior. Follow PyTorch security guidance for distributed features.
🔧 Temporary Workarounds
Disable RemoteModule
allAvoid using RemoteModule feature in distributed PyTorch applications
Network Segmentation
allRestrict network access to PyTorch distributed nodes to trusted sources only
🧯 If You Can't Patch
- Implement strict network controls allowing only trusted nodes to connect to PyTorch distributed services
- Use authentication and encryption for all distributed PyTorch communications
🔍 How to Verify
Check if Vulnerable:
Check if using PyTorch <=2.4.1 with RemoteModule feature enabled in distributed applications
Check Version:
python -c "import torch; print(torch.__version__)"
Verify Fix Applied:
Verify distributed nodes only communicate with trusted endpoints and RemoteModule is not used with untrusted sources
📡 Detection & Monitoring
Log Indicators:
- Unusual connections to PyTorch distributed ports
- Errors in PyTorch distributed module logs
Network Indicators:
- Unexpected traffic to PyTorch distributed RPC ports (default 29500)
SIEM Query:
destination_port:29500 AND NOT source_ip IN [trusted_node_ips]
🔗 References
- https://gist.github.com/hexian2001/c046c066895a963ecc0a2cf9e1180065
- https://github.com/pytorch/pytorch/issues/129228
- https://github.com/pytorch/pytorch/security/policy#using-distributed-features
- https://rumbling-slice-eb0.notion.site/Distributed-RPC-Framework-RemoteModule-has-Deserialization-RCE-in-pytorch-pytorch-111e3cda9e8c8021a7d3cbc61ee1a20c