YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
PyTorch mobile flatbuffer TensorMetadata OOB PoC
This repository contains a minimal proof of concept for a lite-interpreter / mobile flatbuffer vulnerability in PyTorch's torch.jit.mobile._load_for_lite_interpreter(...) path.
What this PoC shows
- A valid
.ptlflatbuffer can be mutated soTensorMetadata.sizes[0]exceeds a 4-byte storage. - On official
torch-2.13.0+cpu,clone_returnleaks heap bytes duringforward(). - On official
torch-2.13.0+cpu,fill_returncrashes withSIGSEGVduringforward().
What this PoC does not show
- It does not claim a generic
torch.jit.loador pickle RCE issue. - It does not prove code execution.
- It is specific to the lite-interpreter / mobile flatbuffer path.
Reproduction
PYTHONPATH=/tmp/pytorch-flatbuffer-test python3 poc_mobile_flatbuffer_tensor_oob.py --scenario clone_return --new-size 8192 --ops summary forward_only
PYTHONPATH=/tmp/pytorch-flatbuffer-test python3 poc_mobile_flatbuffer_tensor_oob.py --scenario fill_return --new-size 8192 --ops summary
Tested version
torch-2.13.0+cpu
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support