Views
No views yet
InferenceSession(...) and returns bytes from the hardlinked external initializer.weights.binmodel_dir/weights.bin as a hardlink to outside_dir/marker.bin. This demonstrates that ONNX Runtime's external-data path validation rejects path escapes and symlinks, but does not enforce ONNX's hardlink protection before reading external initializer data.onnx==1.21.0onnxruntime==1.26.0modelscan==0.8.8onnx_ort_hardlink_case.tar: PoC package preserving the hardlink relationship.verify_poc.py: Extracts the tar, verifies hardlink metadata, then compares ONNX and ONNX Runtime behavior.make_poc.py: Rebuilds the PoC package files from scratch.requirements.txt: Tested dependency versions.1model_dir/poc_ort_hardlink.onnx
2model_dir/weights.bin
3outside_dir/marker.bin hardlink to model_dir/weights.bin1python -m venv .venv
2. .venv/bin/activate
3pip install -r requirements.txt
4
5python verify_poc.pyhardlink_same_inode: truehardlink_count: 2onnx_checker.returncode: non-zeroonnx_load.returncode: non-zeroonnxruntime_file.stdout: ONNX_ORT_HARDLINK_READonnxruntime_absolute.stdout: ONNX_ORT_HARDLINK_READonnxruntime_bytes_with_folder.stdout: ONNX_ORT_HARDLINK_READimpact: onnx_checker_rejects_hardlink_but_onnxruntime_reads_marker.onnx and skips the file, so the main claim is the ONNX checker/runtime mismatch, not a ModelScan ONNX bypass.1b42c0c8d2de4848d40e2b579d9780050a6d9d95b1bc09a8721d974a46eb25ea3 onnx_ort_hardlink_case.tar
2a2c3b161e77dda12f515fc76586df4a995e2ebb6c74876cbc24b68fca7df235b model_dir/poc_ort_hardlink.onnx
3ecccfc04eb086689b520680edb4ab2d9efb8e82abe67c00bef6a160c0ec0599e model_dir/weights.bin
4ecccfc04eb086689b520680edb4ab2d9efb8e82abe67c00bef6a160c0ec0599e outside_dir/marker.bin