
\ are valid directory traversal sequences, and an equivalent attack to retrieve a standard operating system file would be: On Unix-based operating systems, this is a standard file containing details of the users that are registered on the server. sequences step up from /var/www/images/ to the filesystem root, and so the file that is actually read is: is valid within a file path, and means to step up one level in the directory structure. This causes the application to read from the following file path: The application implements no defenses against directory traversal attacks, so an attacker can request the following URL to retrieve an arbitrary file from the server's filesystem: The image files themselves are stored on disk in the location /var/In the above case, the application reads from the following file path: The loadImage URL takes a filename parameter and returns the contents of the specified file.


Images are loaded via some HTML like the following: Reading arbitrary files via directory traversalĬonsider a shopping application that displays images of items for sale.
