Answer the question
In order to leave comments, you need to log in
What is the security hole in the image loading script in this case?
There is a script for uploading an avatar to the site. Here is the line that does the main work:
move_uploaded_file($_FILES['avatar']['tmp_name'], $uploaddir."$username.jpg"
$username
is the username. For the user user , the file user.jpg . Answer the question
In order to leave comments, you need to log in
username
/../../../images/site-logo
invented path - vulnerability - replace any jpg file on the server if slashes are not prohibited in the username
Add php code to the picture at the very end, then just open this picture directly and profit.
This is the "classic" way.
I advise you to check the MIME type in addition to all responses.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question