Plattform
python
Komponente
onnx
Behoben in
1.16.2
CVE-2024-5187 is an Arbitrary File Access vulnerability discovered in the onnx framework, affecting versions up to 1.9.0. This flaw allows attackers to overwrite files on a system by exploiting inadequate path traversal prevention during tar file extraction. Successful exploitation could lead to remote code execution, data loss, and system compromise. A patch is available in version 1.16.2.
The vulnerability lies within the downloadmodelwithtestdata function, where the framework fails to properly sanitize paths within malicious tar archives. An attacker can craft a specially designed tar file containing paths that bypass the intended security checks, allowing them to overwrite arbitrary files on the system. This could involve overwriting critical system files, configuration files, or application data, leading to a complete system takeover. The potential impact extends beyond data corruption; successful file overwrites could facilitate remote code execution, enabling attackers to run arbitrary commands with the privileges of the process running the onnx framework. This vulnerability shares similarities with other path traversal exploits where insufficient input validation allows attackers to access or modify files outside of the intended directory.
CVE-2024-5187 was publicly disclosed on June 6, 2024. The vulnerability's severity is rated HIGH (CVSS: 8.8). While no public proof-of-concept (PoC) code has been widely reported, the ease of crafting malicious tar files suggests a potential for rapid exploitation. It is not currently listed on CISA KEV. Monitor security advisories and threat intelligence feeds for any indications of active exploitation campaigns.
Organizations and developers utilizing the onnx framework in their machine learning pipelines, particularly those processing untrusted data or models from external sources, are at risk. Systems with older versions of onnx deployed in production environments, especially those with limited security controls, are particularly vulnerable.
• python / system:
import os
import tarfile
def check_tar_extraction(tar_file_path, extraction_path):
try:
with tarfile.open(tar_file_path, 'r') as tar:
tar.extractall(path=extraction_path)
print(f"Extraction successful to {extraction_path}")
except Exception as e:
print(f"Extraction failed: {e}")
# Example usage (replace with actual paths)
# check_tar_extraction('/path/to/malicious.tar.gz', '/tmp/extraction_test')• python / library: Examine onnx framework code for instances of tarfile.extractall without proper path sanitization.
• generic web: Monitor web server access logs for requests containing tar files, especially those originating from untrusted sources.
disclosure
Exploit-Status
EPSS
1.36% (80% Perzentil)
CISA SSVC
CVSS-Vektor
The primary mitigation is to upgrade to version 1.16.2 or later, which includes the necessary security fixes. If upgrading immediately is not feasible, consider implementing temporary workarounds. One approach is to restrict the directories where the downloadmodelwithtestdata function can extract tar files to a tightly controlled and isolated location. Additionally, implement strict input validation on any user-provided data used in file path construction. Consider using a Web Application Firewall (WAF) to filter out potentially malicious tar files based on known patterns or signatures. Monitor system logs for suspicious file access or modification events, particularly in directories that should not be modified. After upgrading, verify the fix by attempting to extract a known malicious tar file and confirming that the file access is denied.
Actualice la biblioteca onnx a una versión posterior a la 1.16.0 que corrija la vulnerabilidad de path traversal. Verifique las notas de la versión para confirmar que la vulnerabilidad CVE-2024-5187 ha sido abordada. Puede actualizar la biblioteca utilizando el gestor de paquetes pip: `pip install --upgrade onnx`.
Schwachstellenanalysen und kritische Warnungen direkt in deinen Posteingang.
CVE-2024-5187 is a HIGH severity vulnerability in the onnx framework versions up to 1.9.0 that allows attackers to overwrite files via malicious tar files, potentially leading to remote code execution.
You are affected if you are using onnx versions 1.9.0 or earlier. Check your installed version and upgrade if necessary.
Upgrade to version 1.16.2 or later to remediate the vulnerability. Implement temporary workarounds like restricting extraction directories if immediate upgrade is not possible.
As of now, there are no known public exploits or active campaigns targeting CVE-2024-5187, but continuous monitoring is recommended.
Refer to the onnx project's security advisories and release notes for detailed information: [https://github.com/onnx/onnx/security/advisories](https://github.com/onnx/onnx/security/advisories)
Lade deine Abhängigkeitsdatei hoch und erfahre sofort, ob dich diese und andere CVEs treffen.
Lade deine requirements.txt-Datei hoch und wir sagen dir sofort, ob du betroffen bist.