treforbenbow commited on
Commit
31d927e
·
verified ·
1 Parent(s): b584b61

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +66 -0
README.md ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # TensorRT ONNX External Data Offset Crash PoC
2
+
3
+ ## Vulnerability
4
+
5
+ A crafted ONNX model with an `external_data` weight reference containing a negative
6
+ offset value (`-1`) crashes TensorRT's engine builder with `STATUS_ACCESS_VIOLATION`
7
+ (0xC0000005 on Windows / SIGSEGV on Linux).
8
+
9
+ - **Model size**: 185 bytes (+ 64-byte weight file = 249 bytes total)
10
+ - **Crash rate**: 100% (10/10 runs)
11
+ - **Affected phase**: `build_serialized_network()` (parse succeeds with no error)
12
+ - **Tested on**: TensorRT 10.15.1.29, Windows, CUDA 12.x
13
+
14
+ ## Root Cause
15
+
16
+ The ONNX `external_data` offset field is `int64` in the protobuf spec. TensorRT's
17
+ `WeightsContext.cpp::parseExternalWeights()` does not validate the offset before
18
+ passing it to `seekg()`. Negative values cause undefined behavior in file I/O,
19
+ producing garbage weight data that crashes the builder during optimization.
20
+
21
+ **All negative offsets crash. All offsets >= ~2^32 also crash.**
22
+
23
+ ## Files
24
+
25
+ | File | Description |
26
+ |------|-------------|
27
+ | `crash_offset_neg1.onnx` | Malicious ONNX model (offset=-1) - **CAUSES CRASH** |
28
+ | `benign_offset_0.onnx` | Benign ONNX model (offset=0) - builds normally |
29
+ | `weights.bin` | Weight file (64 bytes, required by both models) |
30
+ | `reproduce.py` | Reproduction script |
31
+
32
+ ## Reproduction
33
+
34
+ ```bash
35
+ pip install tensorrt onnx numpy torch
36
+ python reproduce.py
37
+ ```
38
+
39
+ ### Expected output:
40
+ ```
41
+ [1] Benign model (offset=0):
42
+ benign: rc=0 BUILD_OK size=...
43
+
44
+ [2] Malicious model (offset=-1):
45
+ malicious: CRASH (STATUS_ACCESS_VIOLATION 0xC0000005)
46
+
47
+ [3] Reproducibility (5 runs):
48
+ run 1: CRASH (STATUS_ACCESS_VIOLATION 0xC0000005)
49
+ run 2: CRASH (STATUS_ACCESS_VIOLATION 0xC0000005)
50
+ ...
51
+ Crash rate: 5/5
52
+ ```
53
+
54
+ ## Impact
55
+
56
+ Any TensorRT pipeline that accepts untrusted ONNX models and compiles them will crash:
57
+ - NVIDIA Triton Inference Server
58
+ - TensorRT-LLM ONNX compilation
59
+ - MLOps platforms accepting user-submitted models
60
+ - CI/CD pipelines compiling ONNX models
61
+
62
+ ## Severity
63
+
64
+ High (CVSS 3.1: 7.5 -- AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H)
65
+
66
+ Potential for memory corruption escalation beyond DoS.