Downloads · 30 days
0
WolfpackArmy/pytorch-pickle-rce-poc
pytorch-pickle-rce-poc is a machine learning model from WolfpackArmy. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Arbitrary Code Execution via pickle deserialization in torch.load() (CWE-502)
Downloads · 30 days
0
Access
Public
Updated Apr 12, 2026
Repo size
9.3 KB
Likes
0
Public
Click a slice to open those files.
.pt9.3 KB · 81%
From the Hugging Face model README
Arbitrary Code Execution via pickle deserialization in torch.load() (CWE-502)
poc_torchsave.pt — Malicious .pt file, executes code on torch.load()poc_evil_statedict.pt — Malicious state_dict with embedded payloadbenign_model.pt — Clean model for comparisonbenign_torchscript.pt — Clean TorchScript modelimport torch
# WARNING: This executes arbitrary code
model = torch.load('poc_torchsave.pt', weights_only=False)
# Creates pwned.txt as proof of execution
Any application loading untrusted .pt files with weights_only=False gets arbitrary code execution.