﻿# ONNX Runtime portable packages: a shared asset path must remain inside the package root

The 1.32 shared-assets checks validate package confinement and symlinks; test mutation and removal paths as well as opening a normal package.

Author: Retrivium team
Updated: 2026-11-15
Canonical URL: https://retrivium.ai/journal/week46-engine-ort-portable-package-shared-assets-confinement/
Language: en

ONNX Runtime 1.32.0 hardens portable model-package shared_assets paths and symlink handling. The linked PR validates confinement before operations that read, write or remove package assets. A relative-looking path is not sufficient evidence of containment when canonical resolution or a symlink can lead outside the intended root.

## Lexical appearance is not resolved location

A path without an obvious traversal string can still resolve through a symlink. The PR combines path normalization and ancestry checks with explicit symlink rejection for the relevant assets. A proposed regression builds controlled package trees with ordinary directories and escaping links. Verify the operation fails before touching the outside target. Testing only a string sanitizer would not establish what filesystem object the package operation actually reaches.

## Every mutating route needs the same boundary

The linked work applies validation to loading, copying, committing, pruning and removing shared assets. A passing open-package test does not cover later mutation. A proposed suite exercises these routes separately with the same confined and escaping structures. Keep the destination-root case explicit: validating the source alone cannot prove a commit destination is safe. Different operations can resolve paths at different times and need their own documented preconditions.

## Nonexistent destinations need careful validation too

Creation paths cannot rely only on checking an already existing final file. Parent directories and intended ancestry still matter. The PR distinguishes existence requirements where appropriate. A local test should include a new asset destination beneath an unsafe parent link and confirm rejection. This is an artifact-integrity property, not a recommendation to perform destructive probes against unrelated user files; synthetic temporary package trees provide the necessary controlled evidence.

## Confinement is narrower than universal package trust

Valid paths do not establish model numerical correctness, provenance or every possible loading property. This article reports the release filesystem boundary and proposed asset-operation tests without new security findings. A useful qualification demonstrates correct handling of normal packages and rejection of the documented path escapes, preserving the exact package root and API route that were tested.

## Sources

- [ONNX Runtime v1.32.0 release](https://github.com/microsoft/onnxruntime/releases/tag/v1.32.0)
- [ONNX Runtime pull request #33826](https://github.com/microsoft/onnxruntime/pull/33826)

## Related reading

- [ONNX external data: release the graph and relative tensor files together](/journal/fg2-onnx-external-data-relative-artifact-release/)
- [ONNX Runtime offline optimization: a saved optimized graph inherits a target contract](/journal/fg2-onnxruntime-offline-graph-target-compatibility/)
