root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat vulnerability-pattern-path-traversal.md
// bug-bounty

Path Traversal / LFI

23 Jul 2026 · 2 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

  1. Find download or view endpoints.
  2. Identify the file-referencing parameter.
  3. Try relative paths:
    ../../../../etc/passwd
    , encoded variants like
    ..%2f..%2f..%2fetc%2fpasswd
    , and obfuscated ones like
    ....//....//etc/passwd
    (in case a naive filter strips
    ../
    only once); on Windows try
    ..\..\..\windows\win.ini
    .
  4. 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