CVE-2024-5187: Arbitrary File Overwrite in download_model_with_test_data in onnx/onnx
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
Event History
Frequently Asked Questions
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.
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.
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.
What type of attack does CVE-2024-5187 facilitate?
CVE-2024-5187 facilitates path traversal attacks that can lead to arbitrary file overwriting.
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.