-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
CVE-2019-13232 mitigation triggers test_dir_with_symlinks #57
Comments
Thanks for reporting. Does this mean a zip file can no longer contain both a file and a symbolic link to that file? That is what is being tested in the test case in question. If so, this seems a misguided restriction! Surely people would link to zip up directories containing symlinks. If not, I'd like to understand how to adjust the symlink test so it doesn't trigger this check. @tmspzz since you added support for symlinks, maybe you have some insight on this? Of course, we can always change this test so it doesn't use symlinks. But maybe there's a better way to handle symlinks that wouldn't trigger this test? (Unfortunately, my debian stable zip doesn't seem to include this test, so I can't check this myself.) |
If I understand it correctly, just in case of overlapping files, not recursive files. Please see https://www.bamsoftware.com/hacks/zipbomb/ |
I added support for symlinks to be able to replicate the structure of Apple's framework bundles. I believe the problem with that file is described in the article at "The first insight: overlapping files" The failing zip has this structure:
So there is 1 file in the, 1 symlink and a LFH with a small kernel Clearly though, there is 1 file. So hardly a zip bomb to my understanding |
@tmpszz Do you think there's anything we could be doing differently in our handling of symlinks that would avoid the problem, or is it simply impossible to have an archive in which one file is a symlink to another file in the same archive? I'm sorry, I don't understand all the details in that article, and don't have time to study it now. |
@jgm I don't think it's necessary related to symlinks. The problem might be, in my understanding, in the way the multiple Local File Header (LFH) and the Central directory header (CDH) are encoded to disk. I cannot confirm that this is what is actually happening but to summarize for the problem is:
Details might not be correct but that is the attack vector |
Filling of
CVE-2019-13232
introduced a check against a zipbomb and many (Debian, NixOS) distributions patched against it.It seems that one of the test of zip-archive is using an archive that triggers this check and the test fails. Please see a test failed in NixOS https://logs.nix.ci/?key=nixos/nixpkgs.64909&attempt_id=cc70c8f9-1d57-4b64-8073-42691767eeda
More information about the attach https://www.bamsoftware.com/hacks/zipbomb/
And the patch applied can be found at madler/unzip@47b3cea
The text was updated successfully, but these errors were encountered: