Path Traversal
Vulnerable code snippets
PHP
$file = $_GET['file'];
if(file_exists('/var/www/html/'.$file)) {
readfile('/var/www/html/'. $file);
}JSP
String file = request.getParameter("file");
FileInputStream f = new FileInputStream("/var/www/"+file);
byte[]data = new byte[f.available()];
f.read(data);
f.close();
response.getOutputStream().write(data);Techniques
Last updated