Downloads · 30 days
11
30% of all-time downloads
pragnyanramtha/tensorrt-onnx-symlink-lfr-poc
tensorrt-onnx-symlink-lfr-poc is a machine learning model from pragnyanramtha. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for tensorrt.
This is a benign security PoC. It demonstrates that TensorRT 10.16.1.11 follows a symlink used as an ONNX externaldata.location file, while ONNX 1.21 rejects the same symlink before loading external data.
Downloads · 30 days
11
30% of all-time downloads
All-time downloads
37
Public
Repo size
233 B
Likes
0
Public
Click a slice to open those files.
.py13 KB · 57%
From the Hugging Face model README
This is a benign security PoC. It demonstrates that TensorRT 10.16.1.11 follows a symlink used as an ONNX external_data.location file, while ONNX 1.21 rejects the same symlink before loading external data.
model_dir/model.onnx: ONNX model with initializer W stored in external data.model_dir/weights_link.bin: symlink to the controlled marker file outside model_dir.controlled_sensitive_marker.bin: safe marker file outside model_dir.verify_poc.py: rebuilds the lab and runs validation/inference.results.json: captured local output.The model sets external_data.location to weights_link.bin. That file is inside the model directory but is a symlink to a file outside the model directory.
pip install tensorrt-cu13 onnx numpy modelscan cuda-python
python verify_poc.py --from-staging
Expected result:
weights_link.bin because it is a symlink..onnx as unsupported.[1234.5, 2345.5, 3456.5, 4567.5], proving the external data target outside model_dir was consumed as model weights.An application that accepts untrusted ONNX models for TensorRT compilation can be induced to read external tensor bytes through a symlink that escapes the model directory. If the attacker can control the symlink target and observe inference outputs, this becomes a controlled local-file-read primitive. This PoC reads only a synthetic marker file.
model_dir/model.onnx: 05340543e4e7216db0bb4c10b3ac6701777931e6def0df3a7a68e995402af640controlled_sensitive_marker.bin: d486a60053f484720bd63ca722d0504219f110e77ca974e10b9432d76567a0adBefore TensorRT parses ONNX external data, reject symlinks and require the resolved real path of each external data file to remain inside the intended model directory.