ONNX Path Traversal Vulnerability (CVE-2025-51480)
CVE-2025-51480 is a path traversal vulnerability in ONNX 1.17.0 that allows attackers to overwrite arbitrary files by supplying crafted external_data.location paths containing traversal sequences.
A path traversal vulnerability, identified as CVE-2025-51480, exists within the onnx.external_data_helper.save_external_data component of ONNX (Open Neural Network Exchange) version 1.17.0. This flaw enables a malicious actor to overwrite arbitrary files on the system by crafting a specific external_data.location path. This crafted path incorporates traversal sequences (e.g., “../”) which are designed to bypass intended directory restrictions. This vulnerability can be exploited if an attacker can control the external data location, potentially leading to arbitrary file overwrite and subsequent system compromise.
Attack Chain
- An attacker crafts a malicious ONNX model containing a specially crafted
external_data.locationpath. - The crafted
external_data.locationpath includes path traversal sequences (e.g., “../”) to navigate outside the intended directory. - The attacker provides this malicious ONNX model to a system running ONNX 1.17.0.
- The vulnerable
onnx.external_data_helper.save_external_datafunction processes the malicious model. - Due to the path traversal vulnerability, the function bypasses intended directory restrictions.
- The function attempts to save external data to the attacker-controlled path specified in the
external_data.locationfield. - The attacker overwrites arbitrary files on the system with attacker-controlled data.
Impact
Successful exploitation of CVE-2025-51480 allows an attacker to overwrite arbitrary files on the system where ONNX 1.17.0 is installed. This can lead to various malicious outcomes, including modification of critical system files, planting backdoors, or corrupting application data. The potential impact ranges from denial of service to complete system compromise, depending on the nature of the overwritten files.
Recommendation
- Upgrade to a patched version of ONNX that addresses CVE-2025-51480.
- Apply input validation and sanitization to any user-supplied or external data used to construct file paths within ONNX models.
- Deploy the Sigma rule detecting path traversal attempts to the webserver logs.
- Monitor file system events for suspicious file overwrites, especially involving files referenced in the Sigma rule.
Detection coverage 2
Detects CVE-2025-51480 Path Traversal attempt in ONNX external data helper
highDetects CVE-2025-51480 exploitation attempt using path traversal sequences in external_data.location
Detects CVE-2025-51480 Path Traversal attempt in ONNX external data helper via Python
highDetects CVE-2025-51480 exploitation attempt using path traversal sequences in external_data.location via Python interpreter
Detection queries are available on the platform. Get full rules →