Description
In ONNX before 1.21.0, the 'save_external_data' function builds the external-data file path from the model's external_data location field and opens it for writing without 'O_NOFOLLOW/O_EXCL', after a non-atomic 'os.path.isfile()' check. A local attacker with write access to the directory where a victim serializes external data can deterministically pre-plant a symlink that is being followed, causing the victim's write to append to any file the victim can write, e.g. ~/.ssh/authorized_keys, cron files, or application configs. Fixed in 1.21.0.
Published: 2026-08-21
Score: 6.8 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

An attacker who can write to the directory used by the ONNX 'save_external_data' function can pre‑plant a symbolic link that points to a target file the victim can write to, such as the user’s SSH authorized_keys or cron files. When the victim later serializes the model, the library opens the target path for writing without checking for existing symbolic links or using an exclusive-open flag, causing the victim’s write to append to the target file. This allows the attacker to inject commands or configurations that will be executed by the victim, effectively granting local arbitrary file write and potential privilege escalation.

Affected Systems

ONNX, the open‑source machine‑learning framework, is affected in all releases prior to 1.21.0. Any deployment that uses an older ONNX version and enables the 'save_external_data' feature is vulnerable.

Risk and Exploitability

The CVSS score of 6.8 indicates a moderate severity vulnerability that can be exploited by a local attacker. The EPSS score is not available, and the vulnerability is not listed in CISA’s KEV catalog. The attack requires the attacker to have write access to the directory where the external data is serialized, making the threat most relevant in environments where untrusted code can place models or where the directory is world‑writable. Once exploited, the attacker can append data to arbitrary writable files, including SSH keys, cron jobs, and application configuration files, potentially achieving full control over the affected system.

Generated by OpenCVE AI on August 21, 2026 at 17:34 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade ONNX to version 1.21.0 or newer, where the bug is fixed.
  • Restrict write permissions on the directory used for external data serialization to prevent untrusted users from creating symbolic links.
  • Avoid using the 'save_external_data' feature in environments where the directory permissions cannot be tightly controlled, or replace it with a custom serialization routine that performs atomic, exclusive writes and checks for symlinks.

Generated by OpenCVE AI on August 21, 2026 at 17:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 21 Aug 2026 17:45:00 +0000

Type Values Removed Values Added
First Time appeared Onnx
Onnx onnx
Vendors & Products Onnx
Onnx onnx

Fri, 21 Aug 2026 17:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Fri, 21 Aug 2026 16:15:00 +0000

Type Values Removed Values Added
Description In ONNX before 1.21.0, the 'save_external_data' function builds the external-data file path from the model's external_data location field and opens it for writing without 'O_NOFOLLOW/O_EXCL', after a non-atomic 'os.path.isfile()' check. A local attacker with write access to the directory where a victim serializes external data can deterministically pre-plant a symlink that is being followed, causing the victim's write to append to any file the victim can write, e.g. ~/.ssh/authorized_keys, cron files, or application configs. Fixed in 1.21.0.
Title ONNX symlink-following and path-traversal arbitrary file write
Weaknesses CWE-22
CWE-367
CWE-59
References
Metrics cvssV3_1

{'score': 7.1, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H'}

cvssV4_0

{'score': 6.8, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: cisa-cg

Published:

Updated: 2026-08-21T16:43:10.933Z

Reserved: 2026-05-27T16:19:04.848Z

Link: CVE-2026-49114

cve-icon Vulnrichment

Updated: 2026-08-21T16:42:56.342Z

cve-icon NVD

Status : Received

Published: 2026-08-21T16:17:17.863

Modified: 2026-08-21T17:16:31.203

Link: CVE-2026-49114

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-21T17:30:03Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

  • CWE-367

    Time-of-check Time-of-use (TOCTOU) Race Condition

  • CWE-59

    Improper Link Resolution Before File Access ('Link Following')