File path traversal, traversal sequences stripped with superfluous URL-decode
Description
This lab contains a file path traversal vulnerability in the display of product images. The application blocks input containing path traversal sequences. It then performs a URL-decode of the input before using it.
Reproduction and proof of concept
Use Burp Suite to intercept and modify a request that fetches a product image.
Modify the
filename
parameter, giving it the value:..%252f..%252f..%252fetc/passwd
The response contains the contents of the
/etc/passwd
file:
Exploitability
An attacker will need to encode the payload to retrieve the contents of the /etc/passwd
file