Web SecurityHighDirectory traversal../ attack
Path Traversal
Manipulated file paths escape the intended directory to read or write arbitrary files.
Overview
When a filename/path from input is used without canonicalization, sequences like ../ or encoded variants reach files outside the web root, including secrets and source code.
How it works
When a filename/path from input is used without canonicalization, sequences like ../ or encoded variants reach files outside the web root, including secrets and source code.
Example
Impact
Disclosure of source, config, and credential files; with write access, code execution.
Detection
Probe file/path params with traversal and encoded payloads and detect known file signatures in responses.
Prevention
- Canonicalize and verify the resolved path stays within an allowed base directory.
- Map user input to identifiers, not raw paths.
- Run with least filesystem privilege.