ONNX: Arbitrary File Read via ExternalData Hardlink Bypass in ONNX load
Description
Published by the National Vulnerability Database
Apr 1, 2026
Published to the GitHub Advisory Database
Apr 1, 2026
Reviewed
Apr 1, 2026
Last updated
Apr 1, 2026
Summary
The issue is in
onnx.load— the code checks for symlinks to prevent path traversal, but completely misses hardlinks, which is the problem, since a hardlink looks exactly like a regular file on the filesystem.The Real Problem
The validator in
onnx/checker.cconly callsis_symlink()and never checks the inode orst_nlink, so a hardlink walks right through every security check without any issues.Impact
Especially dangerous in AI supply chain scenarios like HuggingFace — a single malicious model is enough to silently steal secrets from the victim's machine without them noticing anything.
References