External image vulnerabilities

后端 未结 3 1762
小蘑菇
小蘑菇 2020-12-19 09:33

What security holes can appear on my site by including external images via img tag and how to avoid them?

I\'m currently only checking the extension an

3条回答
  •  情深已故
    2020-12-19 09:44

    Well, obviously, you're not doing any checks on the data, so the data can be anything (the mime-type reported by the remote server doesn't necessarily tell the truth). Plus, as you said, the data on the remote server can be changed since you're never looking at it after submission.

    As such, if the link is put into lets say an , then any vulnerability that a browser might have in the image handling can be exploited.

    "Sanitizing" the URL doesn't help with anything: somebody submitting a link that points to a 'bad' image isn't going to attack his own server.

提交回复
热议问题