Directory_traversal_Attack.svg

What is Path or Directory Traversal ?

Path or Directory Traversal is an attack that aims to access files and directories stored outside the intended directory by manipulating file paths using techniques like "dot-dot-slash" (../) or providing absolute file paths.

Impact of path traversal ?

An attacker could gain unauthorized access to critical system files such as:

  1. Source code
  2. Configuration files
  3. Sensitive user data

Note:

The directory traversal vulnerability is known by different names, including:

  1. Path traversal
  2. Dot-dot-slash
  3. Directory climbing
  4. Backtracking vulnerability

How Prevent path traversal ?

1-avoid user-supplied directory

2-Verify the input

3-Don't reinvent the wheel: use open-source libraries