/

CVE-2026-27489

Severity:

HIGH RISK

(7.5)

Path Traversal in ONNX File Handling

CVE-2026-27489

Modified

Vulnerability type

Category:

Path Traversal

CWE:

CWE-23, CWE-61, CWE-22

Impact:

Arbitrary File Read

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

ONNX versions prior to 1.21.0 contain a path traversal vulnerability that allows attackers to leverage symlinks to read files outside the intended model or user-specified directory.

When ONNX processes model-related paths without fully resolving and validating symlinks, an attacker who controls model content or file structure can potentially access arbitrary files on the underlying filesystem.

Affected context

This vulnerability appears in ONNX components that load or manipulate model files and related resources from the filesystem.

It is relevant in environments where:

  • ONNX is given model files or directories that may be influenced by untrusted or semi-trusted parties
  • The application expects ONNX to stay confined to a specific model directory or user-provided path
  • Symlinks within those directories are not treated as potentially dangerous and are resolved without strict validation

The issue becomes more serious on systems where sensitive configuration files, credentials, or keys reside near the ONNX runtime.

Exploit preconditions

  • Attack surface: Local filesystem access via ONNX model loading or processing APIs
  • Required access: Ability to supply or modify model directories, archives, or files that ONNX will load (e.g., upload model, place files on disk, or control extraction locations)
  • Trigger point: ONNX reading or resolving file paths that traverse through a symlink within the model or user-provided directory
  • Why exploitation is possible: Path normalization and directory confinement checks do not adequately account for symlink resolution, allowing computed paths to escape the intended root directory (CWE-23 / CWE-61)

Why this happens

The root cause is insufficient validation of file system paths when following symlinks inside model or user-controlled directories.

ONNX resolves file paths that may include symbolic links without enforcing that the final, fully-resolved path remains within the expected directory boundary.

This maps to CWE-23: Relative Path Traversal and CWE-61: UNIX Symbolic Link Following: the implementation assumes that paths remain confined based on their apparent structure, but symlinks permit redirection to arbitrary locations on the host filesystem.

Potential impact

  • Reading arbitrary files outside the intended model or user directory
  • Exposure of sensitive configuration files, logs, or environment details
  • Disclosure of credentials, API keys, or tokens stored on disk
  • Gathering information that could support further privilege escalation or lateral movement

General mitigation guidance

Effective mitigation focuses on constraining filesystem access and hardening path handling:

  • Normalize and canonicalize all paths after resolving symlinks, and enforce that the final path remains within an allowed root directory
  • Avoid following symlinks in user-controlled directories where possible, or explicitly disallow symlinked entries
  • Run ONNX-based workloads with least-privilege filesystem permissions so that even if traversal occurs, sensitive files are not readable
  • Separate model storage from system and secret storage, placing sensitive material outside any directory tree that untrusted models can influence
  • Treat model artifacts from external parties as untrusted input, applying the same scrutiny used for file uploads or archives

How teams detect issues like this

Organizations can look for this class of issue and its symptoms via:

  • Static analysis rules that flag direct filesystem access using user-influenced paths without robust canonicalization and boundary checks
  • Code review checklists that explicitly ask how symlinks, relative paths, and directory traversal are handled for model files
  • Runtime monitoring for unexpected file access patterns by ONNX processes, such as reads from /etc, user home directories, or secret paths
  • Automated security testing that places crafted symlinks inside model directories to validate that traversal is blocked by defensive controls

Sources

SourceLink
github.comgithub.com/onnx/onnx/commit/4755f8053928dce18a61db8fec71b69c74f786cb
github.comgithub.com/onnx/onnx/security/advisories/GHSA-3r9x-f23j-gc73
access.redhat.comaccess.redhat.com/errata/RHSA-2026:24977
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-27489
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2453929
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-27489.json

Frequently asked

questions

It can be, if a remote user can provide or modify models or directories that ONNX loads (for example, model uploads via an API). The actual exploitability depends on how ONNX is integrated into the application and whether model inputs are exposed to untrusted parties.

The attacker must be able to influence the model directory structure or files ONNX processes, such as by uploading a model bundle containing symlinks or by writing into a directory that ONNX treats as trusted input.

Resolve symlinks and normalize paths before use, then enforce that the resulting canonical path is still within a predefined, restricted directory. In addition, consider rejecting or ignoring symlinks entirely in untrusted directories.

Establish a standard pattern for filesystem access in your codebase: treat all user-influenced paths as untrusted, avoid following symlinks from untrusted sources, enforce strict directory boundaries after canonicalization, and include path traversal checks in code review and automated security testing.

Find out what's already
exploitable in your codebase.