tags:

views:

80

answers:

2

I am wondering this because like many other sites, we have user-submitted images.

I have seen that my friends would send me a instant message that says "Look! I have a awesome picture of you at this party!" which lead me to believe they have some Malware on their computer because after speaking to them, they immediately sign off.

Of course, I do not click on the link but it does have a URL with a extension of a image.

Which leads me to this question, can images be malicious?

+1  A: 

Absolutely: JPEGs have had a particularly tough time. Even if you discount the possibility of an image-based vulnerability, they can be obscene which is just as malicious for most people.

Mark Trapp
+4  A: 

Images can be malicious in rare circumstances (see Mark's link for some prominent examples) but such vulnerabilities usually get patched quickly by the software vendor(s).

However, a link pointing to an image on a web site could easily serve HTML and JavaScript content instead, because the content type is determined by the Content-type property and not the URL's extension.

Pekka
Would I have to do anything on my side to prevent such images being submitted to my site? I didn't really want to be off-topic but I actually left out the part or question where on my side would I have to make any checks to the images.
Anraiki
@Anraiki if you want to be on the totally safe side, consider copying images into new ones using GD. Broken or manipulated images are likely to be simply unreadable, and throw an error in the processx. As a side effect, this would filter out any EXIF metadata in the images that sometimes give away too much information (Applications used to process the image, camera name, location...)
Pekka