chore(deps): update dependency onnx to v1.21.0 [security]#36
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
chore(deps): update dependency onnx to v1.21.0 [security]#36renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.20.1→1.21.0GitHub Vulnerability Alerts
CVE-2026-28500
What's the issue
Passing
silent=Truetoonnx.hub.load()kills all trust warnings and user prompts. This means a model can be downloaded from any unverified GitHub repo with zero user awareness.On top of that, the SHA256 integrity check is useless here — it validates against a manifest that lives in the same repo the attacker controls, so the hash will always match.
Impact
Any pipeline using
hub.load()withsilent=Trueand an external repo string is silently loading whatever the repo owner ships. If that model executes arbitrary code on load, the attacker has access to the machine.Resolved by removing the feature
References
CVE-2026-34445
Summary
The ExternalDataInfo class in ONNX was using Python’s setattr() function to load metadata (like file paths or data lengths) directly from an ONNX model file. The problem? It didn’t check if the "keys" in the file were valid. Because it blindly trusted the file, an attacker could craft a malicious model that overwrites internal object properties.
Why its Dangerous
Instant Crash DoS: An attacker can set the length property to a massive number like 9 petabytes. When the system tries to load the model, it attempts to allocate all that RAM at once, causing the server to crash or freeze Out of Memory.
Access Bypass: By setting a negative offset -1, an attacker can trick the system into reading parts of a file it wasn't supposed to touch.
Object Corruption: Attackers can even inject "dunder" attributes like class to change the object's type entirely, which could lead to more complex exploits.
Fixed: https://github.com/onnx/onnx/pull/7751 object state corruption and DoS via ExternalDataInfo attribute injection
CVE-2026-34446
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.
CVE-2026-34447
Summary
onnx/onnx/checker.cc: resolve_external_data_locationused via Pythononnx.external_data_helper.load_external_data_for_model.Root Cause
resolve_external_data_location(base_dir, location, tensor_name)intends to ensure that external data files reside withinbase_dir. It:..data_path = base_dir / relative_pathexists(data_path)andis_regular_file(data_path)std::filesystem::is_regular_file(path)follows symlinks to their targets. A symlink placed insidebase_dirthat points to a file outsidebase_dirwill pass the checks and be returned. The Python loader then opens the path and reads the target file.Code Reference
auto relative_path = file_path.lexically_normal().make_preferred();std::filesystem::exists(data_path)std::filesystem::is_regular_file(data_path)external_data_helper.load_external_data_for_tensor.Proof of Concept (PoC)
onnx_external_data_symlink_traversal_poc.pytensor.bin. In the model directory, createstensor.binas a symlink to/etc/hosts(or similar). Callsload_external_data_for_model(model, base_dir). Confirms thattensor.raw_datacontains content from the target outside the model directory.python3 onnx_external_data_symlink_traversal_poc.py[!!!] VULNERABILITY CONFIRMED: external_data symlink escaped base_dironnx_external_data_symlink_traversal_poc.py
GHSA-q56x-g2fj-4rj6
Summary
The
save_external_datamethod seems to include multiple issues introducing a local TOCTOU vulnerability, an arbitrary file read/write on any system. It potentially includes a path validation bypass on Windows systems.Regarding the TOCTOU, an attacker seems to be able to overwrite victim's files via symlink following under the same privilege scope.
The mentioned function can be found here: https://github.com/onnx/onnx/blob/main/onnx/external_data_helper.py#L188
Details
TOCTOU
The vulnerable code pattern:
There is a time gap between
os.path.isfileandopenwith no atomic file creation flags (e.g.O_EXCEL | O_CREAT) allowing the attacker to create a symlink that is being followed (absence ofO_NOFOLLOW), between these two calls. By combining these, the attack is possible as shown below in the PoC section.Bypass
There is also a potential validation bypass on Windows systems in the same method (https://github.com/onnx/onnx/blob/main/onnx/external_data_helper.py#L203) alloing absolute paths like
C:\(only 1 part):This may allow Windows Path Traversals (not 100% verified as I am emulating things on a Debian distro).
PoC
Install the dependencies and run this:
Output:
Successfully overwritting the "sensitive data" file.
Impact
The impact may include filesystem injections (e.g. on ssh keys, shell configs, crons) or destruction of files, affecting integrity and availability.
Mitigations
Release Notes
onnx/onnx (onnx)
v1.21.0Compare Source
ONNX v1.21.0 is now available with exciting new features! We would like to thank everyone who contributed to this release!
Please visit onnx.ai to learn more about ONNX and associated projects.
What's Changed
Breaking Changes and Deprecations
Spec and Operator
Reference Implementation
Utilities and Tools
Build, CI and Tests
Documentation
Other Changes
New Contributors
Full Changelog: onnx/onnx@v1.20.1...v1.21.0
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.