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

- Severity: High 8.8 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.17%, higher than 68% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2024-06-06T18:45:19.456Z
- Modified: 2026-06-17T08:15:22.270Z
- Also known as: GHSA-6rq9-53c3-f7vj, PYSEC-2025-148
- Related: CVE-2025-51480
- Weaknesses: CWE-22
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total
- Assigned by: @huntr_ai

## 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.

(As written by CVE List.)

## Affected

- onnx onnx/onnx: from unspecified up to latest
- linuxfoundation onnx: from 1.16.0 before *; 1.16.0
- onnx (PyPI): before 1.16.2; up to 1.17.0

## Every score

- @huntr_ai: CVSS:3.0 8.8 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.0 8.8 High `CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://huntr.com/bounties/50235ebd-3410-4ada-b064-1a648e11237e> (exploit, issue-tracking, third-party-advisory, web)
- <https://www.gecko.security/blog/cve-2025-51480> (exploit, evidence, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-5187> (advisory)
- <https://github.com/onnx/onnx/issues/6215> (web)
- <https://github.com/onnx/onnx/pull/6145> (web)
- <https://github.com/onnx/onnx/pull/6222> (web)
- <https://github.com/onnx/onnx/pull/6959> (fix, web)
- <https://github.com/onnx/onnx/pull/7040> (fix, web)
- <https://github.com/onnx/onnx/commit/1b70f9b673259360b6a2339c4bd97db9ea6e552f> (web)
- <https://github.com/onnx/onnx/commit/3fc3845edb048df559aa2a839e39e95503a0ee34> (web)
- <https://github.com/advisories/GHSA-6rq9-53c3-f7vj> (advisory)
- <https://github.com/onnx/onnx> (package)
- <https://github.com/onnx/onnx/releases/tag/v1.16.2> (web)
- <https://github.com/pypa/advisory-database/tree/main/vulns/onnx/PYSEC-2025-148.yaml> (web)

## Sources

- CVE List: [CVE-2024-5187](https://www.cve.org/CVERecord?id=CVE-2024-5187), CVE Terms of Use, modified 2024-08-01
- GitHub Advisory Database: [GHSA-6rq9-53c3-f7vj](https://github.com/advisories/GHSA-6rq9-53c3-f7vj), CC-BY-4.0, modified 2026-06-06
- NVD: [CVE-2024-5187](https://nvd.nist.gov/vuln/detail/CVE-2024-5187), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2025-148](https://osv.dev/vulnerability/PYSEC-2025-148), CC-BY-4.0, modified 2026-05-21

---

Page: https://cve.day/CVE-2024-5187 · Whole record: https://cve.day/CVE-2024-5187.json · Rebuilt by cve.day 2026-11-25T22:58:41.522Z
