{"id":1237,"date":"2017-02-09T15:38:52","date_gmt":"2017-02-09T13:38:52","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1237"},"modified":"2017-02-09T15:38:52","modified_gmt":"2017-02-09T13:38:52","slug":"zziplib-null-pointer-dereference-in-main-unzzipcat-mem-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/09\/zziplib-null-pointer-dereference-in-main-unzzipcat-mem-c\/","title":{"rendered":"zziplib: NULL pointer dereference in main (unzzipcat-mem.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-mem $FILE\r\n==7919==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000008 (pc 0x7f9a138fb59a bp 0x7ffe1c0b0050 sp 0x7ffe1c0aff78 T0)\r\n==7919==The signal is caused by a READ memory access.\r\n==7919==Hint: address points to the zero page.\r\n    #0 0x7f9a138fb599 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 0x7f9a138e47ab in _IO_puts \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/libio\/ioputs.c:36\r\n    #2 0x509c8b in main \/tmp\/portage\/dev-libs\/zziplib-0.13.62-r1\/work\/zziplib-0.13.62\/bins\/unzzipcat-mem.c:94:6\r\n    #3 0x7f9a1389a61f 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 0x419748 in _init (\/usr\/bin\/unzzipcat-mem+0x419748)\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==7919==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\/00155-zziplib-nullptr-main\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00155-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-mem-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-mem $FILE &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/09\/zziplib-null-pointer-dereference-in-main-unzzipcat-mem-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-jX","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1237"}],"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=1237"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1237\/revisions"}],"predecessor-version":[{"id":1302,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1237\/revisions\/1302"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}