OWASP Hunting

Access control

Path Traversal

Path traversal allows attackers to read arbitrary files on the server by manipulating file path parameters with directory traversal sequences.

Payloads are read from main at 35c1f2b (committed 22 Nov 2026). Project version 1.0.2.

These payloads are for authorized testing only: systems you own, authorized bug bounty programs, or controlled lab environments. Unauthorized testing is illegal.

Payload files

Folder on GitHub

Use the arrow keys to move between payloads. Press Enter or C to copy the focused payload.

path-traversal-payloads.txt

227 payloads · 6.5 KB
Source

Loading payloads for Path Traversal…

What it is#

Path traversal (also known as directory traversal) is a web security vulnerability that allows an attacker to read arbitrary files on the server by inserting ../ sequences into file path parameters. This can expose application code, credentials, system configuration files, and sensitive operating system files.

Attack vectors#

  • File download functionality with a filename parameter
  • File upload functionality with path components
  • Template inclusion parameters
  • Image and document display features
  • Static resource serving with user-controlled paths

Testing methodology#

  1. Submit ../etc/passwd in file path parameters
  2. Try URL-encoded variants: %2e%2e%2fetc%2fpasswd
  3. Test double-encoded: %252e%252e%252fetc%252fpasswd
  4. Test Windows paths: ..\..\windows\win.ini
  5. Try null byte injection: ../etc/passwd%00.jpg to bypass extension checks

Indicators of vulnerability#

  • /etc/passwd contents or Windows win.ini in response
  • Application reads a different file than expected
  • Error messages revealing file system paths

Detection guidance#

Monitor for ../ sequences in file path parameters. Log file access attempts. Alert on access to sensitive paths like /etc/passwd or system directories.

Mitigation and remediation#

  • Validate file paths against an allowlist of permitted directories
  • Use realpath() or equivalent to resolve the canonical path and verify it starts within the allowed directory
  • Avoid using user input to construct file system paths
  • Apply principle of least privilege to file system access

References#

Responsible Use

All content in this reference is for authorized security testing only. Use only on systems you own or have explicit written permission to test.

  • Systems and applications you own
  • Authorized penetration testing engagements
  • Bug bounty programs with defined scope
  • Educational lab environments (DVWA, WebGoat, HackTheBox)