{"id":5025,"date":"2018-02-21T11:04:02","date_gmt":"2018-02-21T10:04:02","guid":{"rendered":"http:\/\/159.69.82.204\/win\/?p=5025"},"modified":"2021-06-17T23:03:08","modified_gmt":"2021-06-17T21:03:08","slug":"security-risk-avoid-7-zip","status":"publish","type":"post","link":"https:\/\/borncity.com\/win\/2018\/02\/21\/security-risk-avoid-7-zip\/","title":{"rendered":"Security-Risk: Avoid 7-Zip"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"float: left; margin: 0px 10px 0px 0px; display: inline;\" src=\"https:\/\/www.borncity.com\/blog\/wp-content\/uploads\/2015\/01\/Schutz.jpg\" width=\"40\" height=\"47\" align=\"left\" \/>[<a href=\"https:\/\/www.borncity.com\/blog\/2018\/02\/20\/warnung-auf-7-zip-verzichten\/\" target=\"_blank\" rel=\"noopener noreferrer\">German<\/a>]Many users are knowing <a href=\"http:\/\/www.7-zip.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">7-Zip<\/a> as a tool for unpacking archive files. The software is free of charge and is also available in a <a href=\"https:\/\/portableapps.com\/de\/apps\/utilities\/7-zip_portable\" target=\"_blank\" rel=\"noopener noreferrer\">portable version<\/a> for Windows. In addition, 7-Zip is also used in various products. Funny world? Unfortunately, there is a dark side of 7-Zip, because the tool is potentially a huge security risk. Here are some hints about what you should know &#8211; and a final piece of advice. Addendum: Newer versions of 7-Zip are using build options like ASLR and DEP.<\/p>\n<p><!--more--><\/p>\n<h2>The problem with packers like 7-Zip<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/ssl-vg03.met.vgwort.de\/na\/ee3c0368409f44ff8072fa49e20656eb\" alt=\"\" width=\"1\" height=\"1\" \/>The core function of a program such as 7-Zip is unpacking of archive files, whereby various formats are to be supported. 7-Zip is quite good for that. The following figure shows the supported formats that can be associated to 7-Zip.<\/p>\n<p><img decoding=\"async\" title=\"7-zip1 - Klicke auf das Bild, um es zu vergr\u00f6\u00dfern\" src=\"https:\/\/web.archive.org\/web\/20191012141612\/https:\/\/administrator.de\/images\/c\/1\/4\/185cab47428957a39f71aafc8424cfc4.jpg\" alt=\"7-zip1 - Klicke auf das Bild, um es zu vergr\u00f6\u00dfern\" \/><\/p>\n<p>Unfortunately, there is a problem with this function: The content of the archive files to be unpacked (i. e. malware) could exploit vulnerabilities in 7-Zip &amp; Co. to extract and execute malicious code. For this purpose, memory overflows must be provoked during unpacking, which can possibly be misused to execute the code. Or, to put it another way: The user tries to unpack a file, and a malware contained in the file becomes active and manipulates the files accessible under the user account. This is something no user expects from 7-Zip, but it is not unrealistic.<\/p>\n<h2>7-Zip and vulnerabilities<\/h2>\n<p>7-Zip is developed by Igor Pavlov and made available free of charge. That's generous, so it isn't easy to criticize. Unfortunately, security vulnerabilities in 7-Zip and the subordinate libraries with packing functions are found again and again. I recently posted the article<\/p>\n<h4><a href=\"https:\/\/borncity.com\/win\/2018\/01\/30\/7-zip-vulnerable-update-to-v18-0-1\/\">7-Zip vulnerable \u2013 update to version 18.01<\/a> about vulnerabilities in this tool and recommended an update to version 18.0 and higher. Igor Pavlov had reacted quickly after discovering the vulnerabilities and provided version 18.01 of 7-Zip. So far so good.<\/h4>\n<p>However, there are some scenarios where older versions of 7-Zip are used. And even third-party providers sometimes use 7-Zip (or sub-functions) in their programs. There older versions of the libraries or the program could be installed or updated on the system (without the user`s knowledge).<\/p>\n<p>This would be the' first thorn' in terms of security, although many users there, admittedly, are not aware of any of the dilemma' 7-Zip variant with security vulnerabilities working on my system' or have little or no influence on this issue.<\/p>\n<p>If you need to use older, vulnerable 7-zip variants (why ever) on your system, you could fix the vulnerabilities CVE-2017-17969 and CVE-2018-5996 with micro-patches from 0patch.com (see their <a href=\"https:\/\/0patch.blogspot.de\/2018\/02\/two-interesting-micropatches-for-7-zip.html\" target=\"_blank\" rel=\"noopener noreferrer\">blog post<\/a>). In the following consideration, however, I exclude this scenario because of its complexity.<\/p>\n<h2>Why 7-Zip puts you at risk<\/h2>\n<p>Let's get to the beef of this article. The developer of this tool refuse to hardening its software against unknown security vulnerabilities. To harden software with respect to the exploitability of unknown vulnerabilities, developers can specify different options when linking modules to an executable binary file. <a href=\"https:\/\/web.archive.org\/web\/20190205141407\/https:\/\/blogs.msdn.microsoft.com\/vcblog\/2009\/05\/21\/dynamicbase-and-nxcompat\/\">This Microsoft document<\/a> introduces two such options for improving application security. There are other techniques (like compiler options to check for buffer overflow in executable code) of this kind, some of which have been known for many years.<\/p>\n<p>Igor Patchev refuses since years to link 7-Zip binary files with the options \/NXCOMPAT and \/DYNAMICBASE. This means that 7-Zip runs on all Windows systems without ASLR. And DEP is enabled only on 64-bit Windows 7 systems and in the 32-bit version of Windows 10.<\/p>\n<p><a href=\"https:\/\/web.archive.org\/web\/20191012141613\/https:\/\/administrator.de\/images\/c\/1\/4\/1f11a3e6e069756e831fc49a630b7f1e.jpg\"><img decoding=\"async\" title=\"7-zip-risk - Klicke auf das Bild, um es zu vergr\u00f6\u00dfern\" src=\"https:\/\/web.archive.org\/web\/20191012141613\/https:\/\/administrator.de\/images\/c\/1\/4\/1f11a3e6e069756e831fc49a630b7f1e.jpg\" alt=\"7-zip-risk - Klicke auf das Bild, um es zu vergr\u00f6\u00dfern\" \/><\/a>(Source: landave.io)<\/p>\n<p>This has been described in <a href=\"https:\/\/landave.io\/2018\/01\/7-zip-multiple-memory-corruptions-via-rar-and-zip\/\" target=\"_blank\" rel=\"noopener noreferrer\">landave's blog<\/a> \u2013 and the image posted above shows, that DEP is deactivated permanently. The author of the linked blog post writes, that 7-Zip was compiled also without the \/GS flag. So there are no checks for stack overflows. Beside the article in in <a href=\"https:\/\/landave.io\/2018\/01\/7-zip-multiple-memory-corruptions-via-rar-and-zip\/\" target=\"_blank\" rel=\"noopener noreferrer\">landave's blog<\/a> I know from another trustable security researcher, that Igor Pavlov has been informed about that potential security risks. Here is a zite from landave's blog post:<\/p>\n<blockquote><p>I have discussed this issue with Igor Pavlov and tried to convince him to enable all three flags. However, he refused to enable <code>\/DYNAMICBASE<\/code> because he prefers to ship the binaries without relocation table to achieve a minimal binary size. Moreover, he doesn't want to enable <code>\/GS<\/code>, because it could affect the runtime as well as the binary size. At least he will try to enable <code>\/NXCOMPAT<\/code> for the next release. Apparently, it is currently not enabled because 7-Zip is linked with an obsolete linker that doesn't support the flag.<\/p><\/blockquote>\n<p>And there's a problem with this: 7-Zip is free of charge, but its author uses outdated development tools and wants to save a few bytes in the program file at the expense of security. This leaves me with at this point to the recommendation, to avoid using this tool \u2013 until it's hardened against attacks to unknown vulnerabilities.<\/p>\n<p>Addendum: This article has been written early 2018. Newer versions of 7-Zip are using nwo build options like ASLR and DEP. So the risks mentioned above, ware no longer valid (as long, as ASLR and DEP are active). To avoid DLL hijacking, I also recommend, not to use the 7-Zip .exe installer &#8211; use the .msi installer instead. In this case, and under the assumption, that the most recent 7-Zip version is used, it should be safe to use that tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[German]Many users are knowing 7-Zip as a tool for unpacking archive files. The software is free of charge and is also available in a portable version for Windows. In addition, 7-Zip is also used in various products. Funny world? Unfortunately, &hellip; <a href=\"https:\/\/borncity.com\/win\/2018\/02\/21\/security-risk-avoid-7-zip\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[580],"tags":[69],"class_list":["post-5025","post","type-post","status-publish","format-standard","hentry","category-security","tag-security"],"_links":{"self":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/5025","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/comments?post=5025"}],"version-history":[{"count":0,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/posts\/5025\/revisions"}],"wp:attachment":[{"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/media?parent=5025"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/categories?post=5025"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/borncity.com\/win\/wp-json\/wp\/v2\/tags?post=5025"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}