TensorRT ModelScan Bypass PoC
Security research: TensorRT engine files (.engine/.trt/.mytrtfile) with embedded native
plugins bypass ModelScan completely and achieve arbitrary code execution via
__attribute__((constructor)) triggered during dlopen() at deserialization time.
For authorized security research only.
Vulnerability Summary
- ModelScan does not recognize TensorRT engine files โ always SKIPPED
- TensorRT
plugins_to_serializeembeds native .so into engine files __attribute__((constructor))executes ondlopen()BEFORE any TensorRT validation- RCE triggers even with
engine_host_code_allowed=False(default safe setting)
Files
malicious_engine.engineโ TensorRT engine with embedded malicious pluginmalicious_plugin.cppโ Source code of the malicious pluginpoc_exhaustive.pyโ Exhaustive verification script (4 tests)
Reproduction
Requires: TensorRT 10.x, CUDA 12.x, GPU with SM 7.0+
import tensorrt as trt
runtime = trt.Runtime(trt.Logger())
# RCE triggers on deserialize โ even with default safe settings
with open('malicious_engine.engine', 'rb') as f:
engine = runtime.deserialize_cuda_engine(f.read())
- Downloads last month
- -
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support