Cloudanix VulnDB

CVE-2024-5480

Critical · 10.0

CVSS

10.0

EPSS

—

Published

Jun 6, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

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

  1. Attacker joins a distributed training cluster as an untrusted worker node
  2. Worker constructs and serializes a PythonUDF containing dangerous callables
  3. UDF is sent to the master node via multi-CPU RPC communication
  4. Master deserializes and executes the UDF without validation
  5. 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