Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1336 CNY

100%

CVE-2024-48063 PoC — PyTorch 安全漏洞

Source
Associated Vulnerability
Title:PyTorch 安全漏洞 (CVE-2024-48063)
Description:In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. NOTE: this is disputed by multiple parties because this is intended behavior in PyTorch distributed computing.
Readme
### PyTorch 中的 `rpc.remote` 使用简介

在 PyTorch 的分布式环境中,`rpc.remote` 函数用于调用远程函数。它可以在指定的节点上异步执行函数,并立即返回一个远程引用(RRef),供你稍后访问远程计算的结果。

#### 使用 `rpc.remote` 的基本步骤

1. **初始化 RPC**:使用 RPC 前,先用 `rpc.init_rpc` 初始化 RPC 框架。
2. **调用 `rpc.remote`**:
   - 指定目标节点的名称或 ID。
   - 传入要调用的函数及参数。
   - 该函数异步执行,返回一个 RRef 对象。
3. **处理返回值**:通过 RRef 可以获取远程计算结果,但要注意,RRef 是远程对象的引用,不是直接的数据。

#### 示例代码

以下是使用 `rpc.remote` 的简单示例:

```python
import torch
import torch.distributed.rpc as rpc

# 初始化 RPC
rpc.init_rpc("worker0", rank=0, world_size=2)

# 定义一个加法函数
def add_tensors(tensor1, tensor2):
    return tensor1 + tensor2

# 使用 rpc.remote 调用远程函数
rref_result = rpc.remote("worker1", add_tensors, args=(torch.ones(2), torch.ones(2) * 2))

# 获取结果
result = rref_result.to_here()  # 阻塞直到结果可用
print(result)  # 输出: tensor([3., 3.])

# 关闭 RPC
rpc.shutdown()
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →