I remember seeing an exploit for an image uploading function, which consisted of hiding malicious php code inside a tiff image.
I'm making my own image uploading script, and I assume I'll have to protect myself from this possibility. Except, that I have no idea how it would work. Does anyone know how a php shell hidden inside an image would execute itself? Would it need to be loaded in a certain way?
Thanks.
Re encoding the image will not stop someone from uploading a shell. The only sure way to prevent it is to re-encode and scan the image for the presence of php tags.
For an example of a PHP PNG shell that will survive re-encoding