| --- |
| license: other |
| --- |
| # ExecuTorch .ptd Null-Pointer Dereference PoC |
|
|
| Security research PoC for Huntr MFV submission. |
|
|
| **Vulnerability**: Missing FlatBuffer verifier + null pointer dereference in `FlatTensorDataMap::load()` when processing malicious `.ptd` external weight files. |
|
|
| **Affected**: pytorch/executorch (latest main, commit 6018283) |
|
|
| **Component**: `extension/flat_tensor/flat_tensor_data_map.cpp:114-125` |
|
|
| ## Files |
|
|
| - `poc_null_sizes.ptd` β TensorLayout present but `sizes` field absent β `sizes()` returns nullptr β SIGSEGV (exit 134) |
| - `poc_null_tl.ptd` β NamedData with no `tensor_layout` β `tensor_layout()` returns nullptr β SIGSEGV (exit 134) |
| - `reproduce.py` β Script to regenerate PoC files |
|
|
| ## Root Cause |
|
|
| `FlatTensorDataMap::load()` calls `GetFlatTensor()` without running `VerifyFlatTensorBuffer()`. The subsequent `create_tensor_layout()` dereferences `tensor_layout->sizes()` without null-checking this optional flatbuffer field. |
|
|