接受图片上传的安全问题 [英] Security issues in accepting image uploads

查看:22
本文介绍了接受图片上传的安全问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了所有 HTTP 上传的常规内容之外,在接受图片上传时需要考虑哪些主要安全问题?

What are the major security issues to consider when accepting image uploads, beyond the normal stuff for all HTTP uploads?

我正在接受图片上传,然后将这些图片展示给其他用户.

I'm accepting image uploads, and then showing those images to other users.

例如,我应该如何验证上传的图片是否是有效的图片文件?查看器中是否存在可被格式错误的图像文件利用的已知漏洞,我应该担心这些漏洞会意外传递漏洞?(快速谷歌搜索似乎表明曾经在 IE5/6 中存在.)

How should I verify, for example, that the uploaded image is actually a valid image file? Are there any known vulnerabilities in viewers that are exploitable by malformed image files for which I should be concerned about accidentally passing along exploits? (Quickly googling seems to show that there once was in IE5/6.)

我是否应该剥离所有图像元数据以帮助用户防止无意的信息泄露?或者是否有一些安全、必要或有用的事情可以允许?

Should I strip all image metadata to help users prevent unintentional information disclosures? Or are there some things that are safe and necessary or useful to allow?

常见图像格式是否存在任何可能成为安全漏洞的神秘功能?

Are there any arcane features of common image formats that could be security vulnerabilities?

有没有处理这些问题的库?(和/或其他问题,例如将渐进式 JPEG 转换为普通 JPEG、下采样以标准化尺寸、优化 PNG 等)

Are there any libraries that deal with these issues? (And/or with other issues like converting progressive JPEGs to normal JPEGs, downsampling to standardize sizes, optimizing PNGs, etc.)

推荐答案

我最近从一个 网络安全视频:

  • 核心选项是从一个单独的域提供所有上传的内容,该域只提供静态内容 - 所有功能都被禁用并且没有任何重要的存储在那里.
  • 考虑通过imagemagick等处理图片,剔除搞笑业务.
  • 有关您遇到的问题的示例,请查看 GIFAR,这是一种将 GIF 和 Java JAR 放在同一个文件中的技术.

这篇关于接受图片上传的安全问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆