【发布时间】:2017-07-01 09:33:13
【问题描述】:
我有一个 python Web 应用程序,它接受来自 URL 的 PDF 文件的 http URL。作为应用程序的一部分,它需要使用 ghost 脚本将 PDF 转换为 TIFF 图像。为此,需要将 PDF 保存在本地。所以要做到这一点,我使用 urllib 像这样:
testfile = urllib.URLopener()
pdf_destination = os.path.join(self.options.storefolder, self.options.uniquecode+".pdf")
testfile.retrieve(pdfurl, pdf_destination) //Fortify vuln. found here
这可以正常工作,但是,Fortify SCA 提供了“路径操纵”的严重漏洞。有没有办法解决这个问题?我是否应该确保 pdfurl 包含有效的 pdf 文件名?还是有更好的方法来解决这个问题?
【问题讨论】:
-
pdfurl 的来源是什么?但我有理由确定您有误报,如果 pdfurl 不是来自用户,请在 Fortify 中将其标记为误报。
-
Pdfurl 确实来自用户
标签: python security ghostscript fortify path-manipulation