What is path traversal?
Path traversal, also known as directory traversal or path traversal attack, is a type of security attack in which an attacker attempts to access files and directories that are outside the web application's assigned directory. The attacker manipulates the path information in the requests to the web application in order to gain access to sensitive files or directories that they should not normally have access to.
Example of path traversal attacks
An example of path traversal is when a web application does not adequately validate user input and an attacker attempts to access the server's password file by typing example.com/page.php?file=../.. /etc/passwd. By using "../" the attacker attempts to work their way back through the directories to access files outside of the web directory.
Path traversal attacks can cause serious security problems because a successful attack can allow an attacker to expose sensitive information such as passwords, configuration files, or sensitive user data. To protect against path traversal attacks, web applications should ensure that all user input is properly validated and sanitized to ensure that requests do not allow unauthorized file paths or directory structures. In addition, Web Application Firewalls (WAFs) such as the Airlock Gateway can be used to monitor suspicious traffic and detect and block attacks early.