| --- |
| license: mit |
| tags: |
| - security |
| - poc |
| - executorch |
| - webgpu |
| --- |
| |
| # Harmless PoC: ExecuTorch WebGPUDelegateHeader unbounded parse |
|
|
| `WebGPUDelegateHeader::parse(const void* data)` reads a fixed header through byte 29 **without** a length argument. `WebGPUBackend::init()` calls it with only `processed->data()`, ignoring `processed->size()`. |
|
|
| A 1-byte `BackendDelegate` processed buffer triggers AddressSanitizer **stack-buffer-overflow** at `WebGPUDelegateHeader.cpp:78` (`memcmp` of magic at offset 4). |
|
|
| ## Files |
| - `short_delegate_blob.bin` — 1-byte processed buffer |
| - `poc_parse_asan.cpp` — standalone ASan harness calling `parse()` |
| - `asan.log` — captured ASan report @ executorch `8077bb60` |
|
|
| ## Reproduce |
| ```bash |
| # From pytorch/executorch checkout: |
| clang++ -std=c++17 -fsanitize=address -fno-omit-frame-pointer -g \ |
| -Isrc -I. \ |
| backends/webgpu/runtime/WebGPUDelegateHeader.cpp \ |
| poc_parse_asan.cpp -o header_asan |
| ASAN_OPTIONS=detect_leaks=0:halt_on_error=1:abort_on_error=1 ./header_asan |
| ``` |
|
|
| Harmless crash PoC only. Requires WebGPU backend sources (parse unit is independent of GPU hardware). |
|
|