Answer the question
In order to leave comments, you need to log in
How to check images for malicious code?
Good afternoon.
The question arose: how to check images for the presence of malicious code, and is it necessary for this scheme of working with images? How dangerous is all this , and where exactly does paranoia begin in this matter?
1. The user uploads an image by accessing the form (select file -> upload);
2. Then on the server it is converted with compression, the file name also changes;
3. The image is displayed to the user.
Answer the question
In order to leave comments, you need to log in
1. Images must be called/given exactly as images. that is, the web server, upon request domain/directory/picture.jpg , should return exactly the picture, even if it contains php code.
in other words - php must be disabled in folders with pictures. each web server does this differently.
2. if there is a malicious code in the picture, then the conversion will most likely return an error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question