CVE-2024-5187
JSON

8.8high

Arbitrary File Overwrite in download_model_with_test_data in onnx/onnx

Severity
8.8high CVSS:3.0 by @huntr_ai
Exploit likelihood
1.17% (higher than 68% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
@huntr_ai
Also known as
GHSA-6rq9-53c3-f7vjPYSEC-2025-148

Description

A vulnerability in the `download_model_with_test_data` function of the onnx/onnx framework, version 1.16.0, allows for arbitrary file overwrite due to inadequate prevention of path traversal attacks in malicious tar files. This vulnerability enables attackers to overwrite any file on the system, potentially leading to remote code execution, deletion of system, personal, or application files, thus impacting the integrity and availability of the system. The issue arises from the function's handling of tar file extraction without performing security checks on the paths within the tar file, as demonstrated by the ability to overwrite the `/home/kali/.ssh/authorized_keys` file by specifying an absolute path in the malicious tar file.

Affected

Product or packageVersionsReported by
onnx onnx/onnxfrom unspecified up to latestCVE List
linuxfoundation onnxfrom 1.16.0 before *, 1.16.0CVE List, NVD
onnx (PyPI)before 1.16.2, up to 1.17.0GitHub Advisory Database, PyPA Advisory Database

All scores

@huntr_ai8.8high CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub8.8high CVSS:3.0CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
PyPA Advisory Database8.8high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

CWE-22

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

A vulnerability in the `download_model_with_test_data` function of the onnx/onnx framework, version 1.16.0, allows for arbitrary file overwrite due to inadequate prevention of path traversal attacks in malicious tar files. This vulnerability enables attackers to overwrite any file on the system, potentially leading to remote code execution, deletion of system, personal, or application files, thus impacting the integrity and availability of the system. The issue arises from the function's handling of tar file extraction without performing security checks on the paths within the tar file, as demonstrated by the ability to overwrite the `/home/kali/.ssh/authorized_keys` file by specifying an absolute path in the malicious tar file.

GitHub Advisory Database

A vulnerability in the download_model_with_test_data function of the onnx/onnx framework, versions before 1.16.2, allow for arbitrary file overwrite due to inadequate prevention of path traversal attacks in malicious tar files. This vulnerability enables attackers to overwrite any file on the system, potentially leading to remote code execution, deletion of system, personal, or application files, thus impacting the integrity and availability of the system. The issue arises from the function's handling of tar file extraction without performing security checks on the paths within the tar file, as demonstrated by the ability to overwrite the /home/kali/.ssh/authorized_keys file by specifying an absolute path in the malicious tar file.

NVD (es)

Una vulnerabilidad en la función `download_model_with_test_data` del framework onnx/onnx, versión 1.16.0, permite la sobrescritura arbitraria de archivos debido a una prevención inadecuada de ataques de path traversal en archivos tar maliciosos. Esta vulnerabilidad permite a los atacantes sobrescribir cualquier archivo en el sistema, lo que podría provocar la ejecución remota de código y la eliminación de archivos del sistema, personales o de aplicaciones, lo que afecta la integridad y disponibilidad del sistema. El problema surge del manejo de la función de extracción de archivos tar sin realizar controles de seguridad en las rutas dentro del archivo tar, como lo demuestra la capacidad de sobrescribir el archivo `/home/kali/.ssh/authorized_keys` especificando una ruta absoluta en el archivo tar. archivo tar malicioso.

PyPA Advisory Database

Path Traversal vulnerability in onnx.external_data_helper.save_external_data in ONNX 1.17.0 allows attackers to overwrite arbitrary files by supplying crafted external_data.location paths containing traversal sequences, bypassing intended directory restrictions.

References

https://huntr.com/bounties/50235ebd-3410-4ada-b064-1a648e11237eexploit, issue-tracking, third-party-advisory, web
https://nvd.nist.gov/vuln/detail/CVE-2024-5187advisory
https://github.com/onnx/onnx/issues/6215web
https://github.com/onnx/onnx/pull/6145web
https://github.com/onnx/onnx/pull/6222web
https://github.com/onnx/onnx/pull/6959fix, web
https://github.com/onnx/onnx/pull/7040fix, web
https://github.com/onnx/onnx/commit/1b70f9b673259360b6a2339c4bd97db9ea6e552fweb
https://github.com/onnx/onnx/commit/3fc3845edb048df559aa2a839e39e95503a0ee34web
https://github.com/advisories/GHSA-6rq9-53c3-f7vjadvisory
https://github.com/onnx/onnxpackage
https://github.com/onnx/onnx/releases/tag/v1.16.2web

Related

Sources

SourceRecordLicence
CVE ListCVE-2024-5187 changed 2024-08-01CVE Terms of Use
GitHub Advisory DatabaseGHSA-6rq9-53c3-f7vj changed 2026-06-06CC-BY-4.0
NVDCVE-2024-5187 changed 2026-06-17Public domain
PyPA Advisory DatabasePYSEC-2025-148 changed 2026-05-21CC-BY-4.0