module

Crinit::PathGuard

PathGuard provides strict path traversal verification to prevent template files, remote assets, or symlinks from escaping target boundaries.

Class methods

ensure_within!(base : Path, target : Path, label : String = "path") : Path

Verifies that target path does not escape base directory via traversal or symlink hops. Returns the expanded and normalized target Path on success. Raises SecurityError if target path traverses outside base directory.

Source