-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
解压缩失败Zip bomb attack detected #3018
Labels
Comments
导出导入测试.zip |
|
经过测试,使用文件方式可以正常读取元信息,但是使用流不行。 保留此issue稍后处理。 |
|
5.8.17修复此问题,感谢~ |
|
5.8.17依然存在这个问题 |
|
@werfei 更新最新试下。 |
|
@A-Pupils-form-china 这里确实是个极端的例子。 5.8.21在 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




版本情况
JDK版本: openjdk_8_201
hutool版本: 5.8.15(请确保最新尝试是否还有问题)
问题描述(包括截图)
使用最新版后,解压zip文件时提示Zip bomb attack detected。之前使用5.5.2版本没有这个问题。
//压缩文件的代码是
ZipUtil.zip(exportDir, Charset.forName("UTF-8"));
// 解压代码
unzipDir = ZipUtil.unzip(modelFile.getInputStream(), tempDir, Charset.forName("UTF-8"));
// 报错信息

cn.hutool.core.exceptions.UtilException: Zip bomb attack detected, invalid sizes: compressed -1, uncompressed -1, name cy_user_process.png
at cn.hutool.core.compress.ZipReader.checkZipBomb(ZipReader.java:247)
at cn.hutool.core.compress.ZipReader.readFromStream(ZipReader.java:224)
at cn.hutool.core.compress.ZipReader.read(ZipReader.java:188)
at cn.hutool.core.compress.ZipReader.readTo(ZipReader.java:148)
at cn.hutool.core.compress.ZipReader.readTo(ZipReader.java:135)
at cn.hutool.core.util.ZipUtil.unzip(ZipUtil.java:665)
at cn.hutool.core.util.ZipUtil.unzip(ZipUtil.java:650)
3. 堆栈信息
比如报错的Excel文件,有问题的图片等。
The text was updated successfully, but these errors were encountered: