Downloads · 30 days
0
ResponsibleReport/safetensors-torchload-rce-poc
safetensors-torchload-rce-poc is a machine learning model from ResponsibleReport. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
convert.py uses torch.load() without weightsonly=True, allowing arbitrary code execution when converting malicious .pt files.
Downloads · 30 days
0
Access
Public
Updated Feb 5, 2026
Repo size
1.8 KB
Likes
0
Public
Click a slice to open those files.
.pt1.8 KB · 41%
From the Hugging Face model README
convert.py uses torch.load() without weights_only=True, allowing arbitrary code execution when converting malicious .pt files.
weights_only=False)weights_only=False for compatibilitymalicious_model.pt contains a pickle payload that executes touch /tmp/safetensors_rce_poc when loaded.
# Using safetensors converter
python convert.py path/to/malicious_model.pt
# Direct test
python -c "import torch; torch.load('malicious_model.pt', weights_only=False)"
ls /tmp/safetensors_rce_poc # File created = RCE
-y flagweights_only=True being available# Add weights_only=True
loaded = torch.load(pt_filename, map_location="cpu", weights_only=True)