PyTorch legacy tar negative nDimension DoS PoC
This repo contains a benign PoC for a valid legacy tar .pt artifact where the tensor metadata field nDimension is set to -1, causing the PyTorch 0.1.10.post2 loader process to abort before the final object pickle is reached.
Files
model/clean_tensor_ndim1.pt— valid clean control artifact (10240bytes)model/crafted_tensor_ndim_neg1.pt— crafted artifact (10240bytes,nDimension=-1)model/build-meta.json— artifact and replay metadatareproduce/replay_negative_ndim_abort.py— replay harness
What it demonstrates
The clean artifact loads successfully in the pinned loader runtime, while the crafted artifact deterministically aborts the real torch.load() process with the message invalid memory size -- maybe an overflow?.
Quick repro
Run:
python3 reproduce/replay_negative_ndim_abort.py --repeat 1
If the local pinned image mfv-pytorch0110-loader:py27 is unavailable, the replay script falls back to python:2.7 plus official wheel URLs for numpy==1.16.6 and torch==0.1.10.post2.
This PoC is for defensive validation and bug-bounty triage only.