The archive that walks outside
An archive member looks contained after lexical normalization but follows an existing link outside the extraction directory.
What’s going wrong
An archive extraction planner checks member names lexically. Pre-existing symbolic links can redirect a harmless-looking member outside the destination.
Input is {"links": {absolute-path:absolute-target,...}, "members":[relative-path,...]}. The virtual extraction root is /work and is never itself a link. Link keys and targets are normalized absolute POSIX paths; there are at most eight links. Resolve paths component by component: . is ignored, .. removes the current resolved component, and encountering a link substitutes its absolute target before processing remaining components. More than 32 followed links is rejected. Reject all absolute member names, and any resolved destination outside /work (including prefix lookalikes such as /workspace). Return an array of resolved absolute destinations or null. The empty member names /work. Members are independent plans; they never create or change links. No host filesystem operations are permitted.
Expected behavior
Containment is checked after virtual link resolution; valid internal links work, traversal and cycles are rejected, and sibling prefixes do not count as containment.
Reproduction
{"links":{"/work/out":"/outside"},"members":["out/report.txt"]}[null]
{"links":{},"members":["a.txt","dir/b.txt"]}["/work/a.txt","/work/dir/b.txt"]
{"links":{"/work/current":"/work/releases"},"members":["current/app.py"]}["/work/releases/app.py"]
Before you begin
- Path components
- Symbolic links
- Containment
- State machines
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
Read the report, then sign in to start your investigation.