I was working with this web-app, when someone pen-tested it and sent me a huge report that says my app is vulnerable to a Directory traversal attack.
Here is one sample:
Testing Path: http://127.0.0.1:80/??/etc/issue <- VULNERABLE!
I put http://127.0.0.1:80/??/etc/issue
in my browser, but it gave me the home page, it didn't at all return the /etc/issue
file.
Then I tried with curl
and it too returned the homepage.
Could somebody please explain me how my app is vulnerable, if the /etc/issue
file is not returned.
The app is coded in Python 2.7, with flask as the framework and Nginx as a reverse proxy.
Two more samples from the report, along with the corresponding response :-
Testing Path: http://127.0.0.1:80/??/etc/passwd <- VULNERABLE!
GET Request -
app: 0|req: 1587/1587] 127.0.0.1 () {34 vars in 488 bytes} [Tue Sep 6 15:47:13 2016] GET /??/etc/passwd => generated 982 bytes in 4 msecs (HTTP/1.1 200) 2 headers in 80 bytes1
Testing Path: http://127.0.0.1:80/??/??/etc/passwd <- VULNERABLE!
GET Request -
app: 0|req: 1591/1591] 127.0.0.1 () {34 vars in 493 bytes} [Tue Sep 6 15:47:14 2016] GET /??/??/etc/passwd => generated 982 bytes in 5 msecs (HTTP/1.1 200) 2 headers in 80 bytes