Instructions to use hacnho/tensorrt-detectionlayer-anchorscnt-suppression-poc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use hacnho/tensorrt-detectionlayer-anchorscnt-suppression-poc with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- security
|
| 4 |
+
- huntr
|
| 5 |
+
- model-file
|
| 6 |
+
- tensorrt
|
| 7 |
+
- detectionlayer
|
| 8 |
+
- output-manipulation
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
# TensorRT DetectionLayer anchors_cnt suppression proof of concept
|
| 12 |
+
|
| 13 |
+
This repository contains a bounded research PoC for `TensorRT (.engine / .trt / .mytrtfile)`.
|
| 14 |
+
|
| 15 |
+
The security question is whether a serialized `DetectionLayer_TRT` payload can carry an attacker-controlled `anchors_cnt` value that is inconsistent with the actual anchor input tensor, while the final engine still deserializes and executes normally and silently suppresses detections.
|
| 16 |
+
|
| 17 |
+
## Files
|
| 18 |
+
|
| 19 |
+
- `control.engine`
|
| 20 |
+
- `anchors-cnt-4096.engine`
|
| 21 |
+
- `verify_remote_poc.py`
|
| 22 |
+
- `requirements.txt`
|
| 23 |
+
|
| 24 |
+
## What the files demonstrate
|
| 25 |
+
|
| 26 |
+
Control:
|
| 27 |
+
|
| 28 |
+
```text
|
| 29 |
+
positive_cls -> [0.5]
|
| 30 |
+
mixed_bbox -> [0.11951626092195511]
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
Malicious serialized `anchors_cnt = 4096`:
|
| 34 |
+
|
| 35 |
+
```text
|
| 36 |
+
positive_cls -> [0.0]
|
| 37 |
+
mixed_bbox -> [0.0]
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
The same suppression was also observed for `anchors_cnt = 128`.
|
| 41 |
+
## Verify the public HF artifacts
|
| 42 |
+
|
| 43 |
+
After unauthenticated download, run:
|
| 44 |
+
|
| 45 |
+
```bash
|
| 46 |
+
python verify_remote_poc.py
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
Expected result:
|
| 50 |
+
|
| 51 |
+
- all engines deserialize successfully
|
| 52 |
+
- all engines execute successfully
|
| 53 |
+
- control output is non-zero on detection presets
|
| 54 |
+
- the `anchors-cnt-4096.engine` output suppresses those detections to zero
|
| 55 |
+
- `semantic_suppression_observed` is `true`
|