{"id":1306,"date":"2017-02-09T15:39:08","date_gmt":"2017-02-09T13:39:08","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1306"},"modified":"2017-02-09T15:39:08","modified_gmt":"2017-02-09T13:39:08","slug":"zziplib-null-pointer-dereference-in-main-unzzipcat-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/09\/zziplib-null-pointer-dereference-in-main-unzzipcat-c\/","title":{"rendered":"zziplib: NULL pointer dereference in main (unzzipcat.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/zziplib.sourceforge.net\/\">zziplib<\/a> is an intentionally lightweight library that offers the ability to easily extract data from files archived in a single zip file.<\/p>\n<p>A fuzz on it discovered an a NULL pointer access.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># unzzipcat $FILE\r\n==22686==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x7f6de98b259a bp 0x7ffddc25a080 sp 0x7ffddc259f98 T0)\r\n==22686==The signal is caused by a READ memory access.\r\n==22686==Hint: address points to the zero page.\r\n    #0 0x7f6de98b2599 in strlen \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/string\/..\/sysdeps\/x86_64\/strlen.S:76\r\n    #1 0x7f6de989b7ab in _IO_puts \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/libio\/ioputs.c:36\r\n    #2 0x509d73 in main \/tmp\/portage\/dev-libs\/zziplib-0.13.62-r1\/work\/zziplib-0.13.62\/bins\/unzzipcat.c:94:6\r\n    #3 0x7f6de985161f in __libc_start_main \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/csu\/libc-start.c:289\r\n    #4 0x419848 in _init (\/usr\/bin\/unzzipcat+0x419848)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/string\/..\/sysdeps\/x86_64\/strlen.S:76 in strlen\r\n==22686==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n0.13.62<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Credit:<\/strong><br \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>CVE:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00158-zziplib-nullptr-main\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00158-zziplib-nullptr-main<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-01-17: bug discovered and poked upstream<br \/>\n2017-02-09: blog post about the issue<\/p>\n<p><strong>Note:<\/strong><br \/>\nThis bug was found with <a href=\"http:\/\/lcamtuf.coredump.cx\/afl\">American Fuzzy Lop<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><br \/>\nhttps:\/\/blogs.gentoo.org\/ago\/2017\/02\/09\/zziplib-null-pointer-dereference-in-main-unzzipcat-c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: zziplib is an intentionally lightweight library that offers the ability to easily extract data from files archived in a single zip file. A fuzz on it discovered an a NULL pointer access. The complete ASan output: # unzzipcat $FILE &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/09\/zziplib-null-pointer-dereference-in-main-unzzipcat-c\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":140,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[12,10],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2EaBc-l4","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1306"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/users\/140"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/comments?post=1306"}],"version-history":[{"count":2,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1306\/revisions"}],"predecessor-version":[{"id":1308,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1306\/revisions\/1308"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1306"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1306"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1306"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}