A filesystem path is a route. When user input is joined to a base directory, normalization decides whether the route stays inside the building.
The application joins a user-controlled filename to a public directory. `../` moves up one level. If the resolved path is not checked against the base directory, the attacker reads files outside it.
- Inspect the download request
- Traverse out of the public directory
- Read the restricted file and capture the flag
Request parameter to filesystem path
Where to look before you type a payload
A route accepts a filename, document key, template name or export path.
The handler concatenates the value with a base directory, sometimes after a naive replace of ../.
The filesystem resolves . and .. segments, encoded characters and symlinks.
The process opens the resolved path with the privileges of the application user.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Find the file or download parameter.
Hint 2
Try `../` and watch how the server normalizes the path.
Hint 3
The path is joined to /var/www/files. Move up one directory and read secret/flag.txt.
Hint 4 · near the answer
Read `../secret/flag.txt` and capture the flag.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — The Export Center - Family: Path Traversal - Lab ID: web-traversal-export - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "The Export Center" and record /download, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects /download, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: The download handler joins the requested name to the public directory without rejecting .. segments. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the file path value. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The server returns 400 for ../: test encoded variants, double encoding, backslashes and Unicode normalization.
- A filename is passed to an object store: traversal may appear as key confusion or prefix escape rather than a local file read.
- The input is sanitized by removing ../ once: nested patterns such as ....// can reconstruct the sequence after replacement.
Regression tests to name
- Basic traversal: The server rejects it or returns only a file inside the allowed directory
- Encoded traversal: Canonicalization still confines the path to the root
- Absolute path: The path is rejected, not treated as absolute
- Canonicalize the resolved path and verify it is still inside the intended root.
- Prefer mapping an ID to a known file instead of accepting a path.
- Run the service with a filesystem sandbox and least privilege.
الخطر في المسار بعد التطبيع، وليس في النص الذي أرسلته.