Confine cache restore to the requested paths (#3) #6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/3-confine-restore"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
Restore extracts with
tar -xpP, which trusts absolute member paths, so a poisoned cache object could write or link outside the requested cache paths (#3). Restore now enumerates the archive withtar -tvPand confines every member, symlink, and hardlink target to the roots derived from thepath:patterns before extracting...traversal, and escaping symlinks/hardlinks abort the restore before anything is written.glob.restoreRootsderives the allowlist from the literal prefix of each pattern (negations ignored; they only shrink what was saved).How it was tested
make lintclean (actionlint/yq absent locally and skipped)make testgreen (55 tests)..traversal, escaping symlink) assert refusal with nothing written, plus unit coverage for the listing parser, the confinement check (hardlinks included), and root derivationCHANGELOG updated? yes