CVE-2024-5480
Critical · 10.0CVSS
10.0
EPSS
—
Published
Jun 6, 2024
CISA due date
—
Cloudanix analysis
A communication flaw in a popular machine learning library lets outsiders remotely take control of computers running distributed training jobs and steal valuable data.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Remote Code Execution
- Component
- Library
- Class
- Command Injection
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The vulnerability permits remote code execution by allowing unvalidated PythonUDF objects containing arbitrary callables such as eval to be deserialized and invoked on the master node during RPC operations in the torch.distributed.rpc framework.
Why it matters to the business
Attackers can fully compromise master nodes used for distributed machine learning training, resulting in theft of proprietary models, training data, and intellectual property with no authentication required.
How an attack unfolds
An attacker deploys a malicious worker process that participates in a distributed training job, serializes a PythonUDF referencing built-in functions like eval, and transmits it over the RPC channel; the receiving master deserializes and executes the function without verification, granting arbitrary command execution.
How to fix it
Upgrade PyTorch to version 2.2.2 or later where RPC function validation has been added; disable the distributed.rpc module when not required and enforce network segmentation between worker and master nodes.
How to confirm the fix worked
Confirm all PyTorch installations report version 2.2.2 or newer; review RPC-related code paths for any remaining direct use of PythonUDF or eval; test that unauthorized callables are rejected during simulated RPC exchanges.
Typical attack path
- Attacker joins a distributed training cluster as an untrusted worker node
- Worker constructs and serializes a PythonUDF containing dangerous callables
- UDF is sent to the master node via multi-CPU RPC communication
- Master deserializes and executes the UDF without validation
- Attacker obtains code execution on the master and exfiltrates AI assets
How to detect it
Inspect RPC logs and training job logs for unexpected PythonUDF deserialization events or invocations of eval, exec, or similar builtins; correlate with network connections from untrusted worker IPs to master nodes.
What your security team should do
- Immediately inventory all PyTorch deployments and prioritize upgrade of any version prior to 2.2.2
- Restrict network access so only trusted hosts can initiate RPC connections to master nodes
- Monitor for anomalous PythonUDF traffic or unexpected eval usage in training logs
- Consider disabling torch.distributed.rpc entirely if distributed training is not essential
The record
A vulnerability in the PyTorch's torch.distributed.rpc framework, specifically in versions prior to 2.2.2, allows for remote code execution (RCE). The framework, which is used in distributed training scenarios, does not properly verify the functions being called during RPC (Remote Procedure Call) operations. This oversight permits attackers to execute arbitrary commands by leveraging built-in Python functions such as eval during multi-cpu RPC communication. The vulnerability arises from the lack of restriction on function calls when a worker node serializes and sends a PythonUDF (User Defined Function) to the master node, which then deserializes and executes the function without validation. This flaw can be exploited to compromise master nodes initiating distributed training, potentially leading to the theft of sensitive AI-related data.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | pytorch | 0 | No fix |
| Debian:12 | pytorch | 0 | No fix |
| Ubuntu:22.04:LTS | pytorch | 0 | No fix |
| Ubuntu:24.10 | pytorch | 0 | No fix |
| Ubuntu:25.04 | pytorch | 0 | No fix |
Related vulnerabilities
- CVE-2025-32434 PyTorch: `torch.load` with `weights_only=True` leads to remote code execution Also affects pytorch
- CVE-2025-3730 PyTorch Improper Resource Shutdown or Release vulnerability Also affects pytorch
- CVE-2025-2953 A vulnerability, which was classified as problematic, has been found in PyTorch… Also affects pytorch
- CVE-2024-48063 In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. Also affects pytorch
- CVE-2024-35198 TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in… Also affects pytorch
- CVE-2026-114575 A flaw has been found in TOTOLINK A950RG 4.1.2cu.5268_B20221104. CWE-77
- CVE-2026-112942 launch-editor allows users to open files with line numbers in editor from Node.js. CWE-77
- CVE-2026-55453 OpenPrinting CUPS is an open source printing system for Linux and other Unix-like… CWE-77