Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- tensorrt
|
| 5 |
+
- security-research
|
| 6 |
+
- vulnerability-poc
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# VULN-010: Uncontrolled Recursion in TensorRT ONNX Parser via Recursive FunctionProto
|
| 10 |
+
|
| 11 |
+
## Summary
|
| 12 |
+
|
| 13 |
+
A 110-byte ONNX model with a self-referencing FunctionProto definition crashes TensorRT ONNX parser (nvonnxparser) with stack overflow (STATUS_STACK_OVERFLOW / 0xC00000FD) during parse(). The parser performs unbounded recursion when expanding the function body, which references itself, exhausting the call stack.
|
| 14 |
+
|
| 15 |
+
- CWE: CWE-674 (Uncontrolled Recursion)
|
| 16 |
+
- Severity: High (CVSS 7.5)
|
| 17 |
+
- Affected: TensorRT 10.15.1.29 (and likely all TRT 10.x with ONNX parser)
|
| 18 |
+
- Reproducibility: 100% (10/10)
|
| 19 |
+
|
| 20 |
+
## Vulnerability Details
|
| 21 |
+
|
| 22 |
+
ONNX IR v8+ supports FunctionProto, which are inline function definitions within a model. TensorRT ONNX parser processes these via the LocalFunctionImporter in onnxOpCheckers.cpp. During the static checking phase (parseNodeStaticCheck), when the parser encounters a node that references a local function, it recursively processes that function body nodes.
|
| 23 |
+
|
| 24 |
+
The model import path (ModelImporter.cpp) has a recursion depth limit (kMAX_NESTED_SUBGRAPHS = 24), but the static checking phase runs first and has no recursion depth limit. A self-referencing FunctionProto causes infinite recursion in the static check path, exhausting the call stack before the depth-limited import phase is reached.
|
| 25 |
+
|
| 26 |
+
The model passes onnx.checker.check_model() and is structurally valid ONNX.
|
| 27 |
+
|
| 28 |
+
## Files
|
| 29 |
+
|
| 30 |
+
- vuln010_self_recursive.onnx (110 bytes) - Self-recursive function (R calls R)
|
| 31 |
+
- vuln010_mutual_recursive.onnx (152 bytes) - Mutually recursive (A calls B, B calls A)
|
| 32 |
+
- vuln010_standalone_poc.py - Build/crash/verify script
|
| 33 |
+
|
| 34 |
+
## Reproduction
|
| 35 |
+
|
| 36 |
+
python vuln010_standalone_poc.py build # Build PoC models
|
| 37 |
+
python vuln010_standalone_poc.py verify # Runs 5 trials per variant
|
| 38 |
+
python vuln010_standalone_poc.py crash # Triggers crash (terminates process)
|
| 39 |
+
|
| 40 |
+
## Impact
|
| 41 |
+
|
| 42 |
+
- Denial of Service: Any application using TensorRT ONNX parser can be crashed
|
| 43 |
+
- No recovery: Stack overflow is not catchable, process terminates unconditionally
|
| 44 |
+
- Tiny payload: 110 bytes
|
| 45 |
+
- Bypasses validation: Passes onnx.checker.check_model()
|
| 46 |
+
- Supply chain risk: Malicious model on HuggingFace/model zoo crashes any TRT pipeline
|
| 47 |
+
|
| 48 |
+
## Tested On
|
| 49 |
+
|
| 50 |
+
- TensorRT 10.15.1.29
|
| 51 |
+
- Windows 11, RTX 4080 Super, CUDA 12.x
|
| 52 |
+
- Python 3.12
|