root@sparrow:~/writeups$ cat vulnerability-pattern-path-traversal.md
// bug-bounty
Path Traversal / LFI
23 Jul 2026
· 1 min read
What it is
Reading internal files by manipulating a path parameter with relative path sequences —
../../../../etc/passwd tacked onto a parameter meant to point at a document the app was supposed to serve.Why it matters
It reaches straight past the application layer into the filesystem — config files, credentials, source code and environment variables are all fair game if the traversal isn't blocked.
Where to look
- Download and view-document endpoints, export features
- Parameters named
,file=
,path=
,template=
,page=document=
How I test it
- Find download or view endpoints.
- Identify the file-referencing parameter.
- Try relative paths:
, encoded variants like../../../../etc/passwd
, and obfuscated ones like..%2f..%2f..%2fetc%2fpasswd
(in case a naive filter strips....//....//etc/passwd
only once); on Windows try../
...\..\..\windows\win.ini - Check whether the response contains unexpected file content instead of the usual document.
Hunting checklist
- Found a file/path/download parameter
- Tried plain relative-path traversal
- Tried URL-encoded and double-slash-obfuscated variants
- Tried the OS-appropriate separator (\ on Windows)
- Confirmed actual file content in the response, not just a different error
Evidence to collect
- Vulnerable endpoint and parameter
- Payload used
- Response containing the internal file's content
- Explanation of what that file exposes (config, credentials, source code)
Recommended fix
- Never build file paths from user input directly
- Resolve the path and verify it stays inside an allowed base directory
- Use an internal ID/allowlist of filenames instead of accepting a path
- Run the process with minimal filesystem permissions