Skip to main content

Module paths

Module paths 

Source
Expand description

Run-time path containment (contain_within) — shared by actions that resolve user-supplied relative paths (docker, federation). Run-time path containment — the filesystem half of the two-stage validation used by actions that resolve user-supplied relative paths (docker’s dockerfile/context, federation’s manifest).

The lexical half lives in the manifest validator (check_contained_path): relative-only, no .. component, no leading dash, no control characters. That check cannot see symlinks — sub pointing at /etc is lexically clean. contain_within closes the hole by canonicalizing and requiring the result to stay inside the canonicalized base.

Functions§

contain_within
Resolve relative against base and require the canonicalized result to stay inside canonicalized base.