CVE-2024-5187
Arbitrary File Overwrite in download_model_with_test_data in onnx/onnx
Also known as CVE-2025-51480, GHSA-6rq9-53c3-f7vj, PYSEC-2025-148
Mitigation
- Upgrade onnx to 1.16.2 or later.
Who should check
- Projects that depend on PyPI package onnx (< 1.16.2)
- Anyone running onnx/onnx >= unspecified, <= latest
Vulnerability facts
- Affected
- onnx < 1.16.2
- Fixed in
- 1.16.2
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- Yes: see the exploit references below
- Remote exploitation
- Remote, no login needed
- CVSS
- 8.8 (v3.0, CNA)CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: High
- Integrity impact: High
- Availability impact: High
- EPSS
- 1.79% chance of exploitation in 30 days (percentile 79, 2026-11-26)
- CWE
- CWE-22
- Modified
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 and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2024-5187. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2024-5187.md Affected: onnx < 1.16.2 Fixed in: 1.16.2 Steps: 1. Search this machine and project for onnx (PyPI), onnx/onnx: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
Patches
- https://github.com/onnx/onnx/pull/6145
- https://github.com/onnx/onnx/pull/6222
- https://github.com/onnx/onnx/pull/6959
- https://github.com/onnx/onnx/pull/7040
- https://github.com/onnx/onnx/commit/1b70f9b673259360b6a2339c4bd97db9ea6e552f
- https://github.com/onnx/onnx/commit/3fc3845edb048df559aa2a839e39e95503a0ee34
Exploits and PoCs
FAQ
Is CVE-2024-5187 being exploited?
There is no confirmed exploitation: CVE-2024-5187 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 1.79% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2024-5187?
High: CVSS 8.8 (v3.0, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work.
Which versions are affected by CVE-2024-5187?
onnx < 1.16.2.
Is there a fix for CVE-2024-5187?
Yes. Fixed in 1.16.2. Upgrade onnx to 1.16.2 or later.
How do I check if I'm affected by CVE-2024-5187?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.