Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. onnx
  4. ›
  5. CVE-2026-34447

CVE-2026-34447: ONNX: External Data Symlink Traversal

April 1, 2026 (updated June 8, 2026)

Summary

  • Issue: Symlink traversal in external data loading allows reading files outside the model directory.
  • Affected code: onnx/onnx/checker.cc: resolve_external_data_location used via Python onnx.external_data_helper.load_external_data_for_model.
  • Impact: Arbitrary file read (confidentiality breach) when a model’s external data path resolves to a symlink targeting a file outside the model directory.

Root Cause

  • The function resolve_external_data_location(base_dir, location, tensor_name) intends to ensure that external data files reside within base_dir. It:
  • Rejects empty/absolute paths
  • Normalizes the relative path and rejects ..
  • Builds data_path = base_dir / relative_path
  • Checks exists(data_path) and is_regular_file(data_path)
  • However, std::filesystem::is_regular_file(path) follows symlinks to their targets. A symlink placed inside base_dir that points to a file outside base_dir will pass the checks and be returned. The Python loader then opens the path and reads the target file.

Code Reference

  • File: onnx/onnx/checker.cc:970-1060
  • Key logic:
  • Normalization: auto relative_path = file_path.lexically_normal().make_preferred();
  • Existence: std::filesystem::exists(data_path)
  • Regular file check: std::filesystem::is_regular_file(data_path)
  • Returned path is later opened in Python: external_data_helper.load_external_data_for_tensor.

Proof of Concept (PoC)

  • File: onnx_external_data_symlink_traversal_poc.py
  • Behavior: Creates a model with an external tensor pointing to tensor.bin. In the model directory, creates tensor.bin as a symlink to /etc/hosts (or similar). Calls load_external_data_for_model(model, base_dir). Confirms that tensor.raw_data contains content from the target outside the model directory.
  • Run:
  • python3 onnx_external_data_symlink_traversal_poc.py
  • Expected: [!!!] VULNERABILITY CONFIRMED: external_data symlink escaped base_dir

onnx_external_data_symlink_traversal_poc.py

References

  • github.com/advisories/GHSA-p433-9wv8-28xj
  • github.com/onnx/onnx/security/advisories/GHSA-p433-9wv8-28xj
  • github.com/pypa/advisory-database/tree/main/vulns/onnx/PYSEC-2026-104.yaml
  • nvd.nist.gov/vuln/detail/CVE-2026-34447

Code Behaviors & Features

Detect and mitigate CVE-2026-34447 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 1.21.0

Fixed versions

  • 1.21.0

Solution

Upgrade to version 1.21.0 or above.

Impact 5.5 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-61: UNIX Symbolic Link (Symlink) Following

Source file

pypi/onnx/CVE-2026-34447.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 08 Nov 2026 00:15:23 +0000.