我有一个Web应用程序,允许用户将文件上传到Web服务器,然后将其保存到数据库 . 其中一位安全人员表示,我需要做的就是尝试将文件保存到Web服务器,这将启动病毒扫描 . 然后我可以删除该文件并将其保存到数据库中 . 但是,我对此表示担忧:
-
如果我暂时将文件保存到Web服务器,如果发现病毒,文件是否会无法保存?
-
如果失败,我应该期待什么类型的例外?
-
从命令行运行病毒扫描程序更好吗?
-
这样安全吗?阅读这篇文章:File upload security Concern我担心这一行:"Ensure that the directory you will save to is not readable by the web server, this way they don't upload a malware script and then execute it from their browser via an HTTP"
1 回答
某些防病毒供应商具有基于服务器的工具,允许您以编程方式提交要扫描的文件 . 例如,我们通过ICAP接口使用了Symantec Scan Engine(请参阅http://www.symantec.com/business/support/index?page=content&id=TECH83878) .
其他防病毒供应商有其他工具提供相同或类似的功能 .