Directory Traversal Attacks

What is Directory Traversal?

Directory traversal (also known as file path traversal) is a web security vulnerability that allows an attacker to read arbitrary files on the server that is running an application. This might include application code and data, credentials for back-end systems, and sensitive operating system files. Attackers can exploit this vulnerability by manipulating variables that reference files with "dot-dot-slash (../)" sequences and its variations or by using absolute file paths.


Directory Traversal Attack Examples

Here are some examples of directory traversal attacks:


Preventing Directory Traversal Attacks

Preventing directory traversal attacks involves proper input validation and sanitization. This includes: