|
Download README.md from Kanisia/tensorizer-huge-header-allocation-dos: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/Kanisia/tensorizer-huge-header-allocation-dos/resolve/main/README.md
- Command line
-
hf download hf://Kanisia/tensorizer-huge-header-allocation-dos/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/Kanisia/tensorizer-huge-header-allocation-dos/resolve/main/README.md
721 Bytes
| # Tensorizer Huge Header Allocation DoS | |
| This repository contains a small Tensorizer `.tensors` proof of concept. | |
| The PoC file declares a very large per-tensor header length while only containing | |
| the first eight bytes of that header. `TensorDeserializer.read_numpy_arrays()` | |
| allocates `bytearray(header_len)` before checking that the declared header bytes | |
| exist in the file. | |
| Run: | |
| ```bash | |
| python build_and_verify.py | |
| ``` | |
| Expected result: | |
| - `control_small_header.tensors` returns quickly. | |
| - `tensorizer_huge_header_allocation_dos.tensors` is only 122 bytes but declares | |
| an 8 GiB tensor header and causes a large allocation / long delay before | |
| raising a parser error. | |
| - ModelScan reports no issues for the PoC file. | |