↓ Skip to main content
  1. Writeups/

Lab Note: Path Traversal Review

·169 words·1 min
Abdul Moiz
Author
Abdul Moiz
I test systems with permission and turn findings into clear, actionable fixes.

Fictional lab: This writeup describes an intentionally vulnerable sandbox application.

Context
#

The sample application offers downloads from a report directory. A request supplies a file name, and the service joins it to the configured directory before reading the file.

Observation
#

The lab’s input check filters a few obvious strings but does not verify the resolved file path. A crafted input in the sandbox resolves outside the report directory. The response returns a harmless fixture file placed there for the exercise.

Impact
#

The demonstrated behavior crosses the intended directory boundary. In a real system, the sensitivity of reachable files would determine severity; the lab makes no claim about a production target.

Remediation
#

Resolve the requested path against a fixed base directory and reject paths that escape it. Prefer server-side identifiers over client-supplied file paths. Keep the file reader’s permissions limited to the files it needs.

Verification
#

Retest ordinary downloads and boundary cases. The fixed lab serves approved reports while rejecting paths outside the configured directory.