本文主要是介绍POI - 压缩炸弹 Zip bomb,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误日志
Zip bomb detected! The file would exceed the max. ratio of compressed file size to the size of the expanded data.
This may indicate that the file is used to inflate memory usage and thus could pose a security risk.
You can adjust this limit via ZipSecureFile.setMinInflateRatio() if you need to work with files which exceed this limit.
Uncompressed size: 233647, Raw/compressed size: 2324, ratio: 0.009947
Limits: MIN_INFLATE_RATIO: 0.010000, Entry: xl/styles.xml
解决方式
Sets the ratio between de- and inflated bytes to detect zipbomb. It defaults to 1% (= 0.01d), i.e. when the compression is better than 1% for any given read package part, the parsing will fail indicating a Zip-Bomb.
参考资料
ZipSecureFile (POI API Documentation)
这篇关于POI - 压缩炸弹 Zip bomb的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!