Validate uploaded image content in ASP.NET
A very few day ago i had to face the situation where hacker uploaded the malicious ASP script to the web server by changing its extension to .JPG through user interface which allow user to upload image file. Although developer team had put the validation on extension. But unfortunately extension of ASP script was .JPG and hence it is allowed extension. So hacker could upload that malicious script.
After this situation i thought just checking only extension for uploaded file is not the sufficient. We need to check content as well of the uploaded file.
After this situation i thought just checking only extension for uploaded file is not the sufficient. We need to check content as well of the uploaded file.