Expand description
Path-traversal-safe join primitive (CWE-22 guard).
safe_join resolves a caller-supplied relative path against a base
directory at the string layer, rejecting any input that would escape
the base via .., an absolute path, a drive / UNC prefix, or a NUL
byte. It is the companion to the capability-based cap-std migration
described in skills/rust-path-security.md; until that lands it gives
every external-input path junction a single, audited choke point.
Functionsยง
- is_
safe_ relative_ path - Whether
inputis a safe relative subpath: no..traversal, not absolute, no drive / UNC prefix, no NUL byte. - safe_
join - Join
inputontobase, returningNoneifinputwould escapebase.