CVE-2024-5187: Arbitrary File Overwrite in download_model_with_test_data in onnx/onnx

Published Jun 6, 2024
·
Updated

A vulnerability in the downloadmodelwithtestdata 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/authorizedkeys file by specifying an absolute path in the malicious tar file.

Other sources

A vulnerability in the downloadmodelwithtestdata 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/authorizedkeys file by specifying an absolute path in the malicious tar file.

GitHub

Open Neural Network Exchange (ONNX) could allow a remote attacker to traverse directories on the system, caused by improper archive file validation by the downloadmodelwithtestdata function. An attacker could use a specially crafted archive file containing "dot dot" sequences (/../) to overwrite arbitrary files on the system.

IBM

Affected Software

3 affected componentsFixes available
pip/onnx<1.16.2
1.16.2
linuxfoundation Onnx=1.16.0
debian/onnx
1.7.0+dfsg-31.12.0-21.17.0-31.20.0-4

Event History

Jun 6, 2024
CVE Published
via MITRE·06:45 PM
Data Sourced
via MITRE·06:45 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·09:30 PM
May 2, 2025
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
May 27, 2026
Data Sourced
via Ubuntu·09:11 PM
RemedyDescriptionSeverityAffected Software
Data Sourced
via Launchpad·09:12 PM
Description
Data Sourced
via Debian·09:12 PM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-5187?

CVE-2024-5187 has been rated as a high severity vulnerability due to its potential for arbitrary file overwrite.

2

How do I fix CVE-2024-5187?

To resolve CVE-2024-5187, upgrade the onnx package to version 1.17.0 or later, or 1.16.2.

3

Which versions of ONNX are affected by CVE-2024-5187?

CVE-2024-5187 affects ONNX version 1.16.0 and older versions prior to 1.17.0.

4

What type of attack does CVE-2024-5187 facilitate?

CVE-2024-5187 facilitates path traversal attacks that can lead to arbitrary file overwriting.

5

Who is impacted by CVE-2024-5187?

Users and organizations using ONNX version 1.16.0 or earlier in their applications are impacted by CVE-2024-5187.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203