{"id":1398,"date":"2017-03-02T18:24:22","date_gmt":"2017-03-02T16:24:22","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1398"},"modified":"2017-03-13T11:57:49","modified_gmt":"2017-03-13T09:57:49","slug":"podofo-null-pointer-dereference-in-colorchangergetcolorfromstack-colorchanger-cpp","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-colorchangergetcolorfromstack-colorchanger-cpp\/","title":{"rendered":"podofo: NULL pointer dereference in ColorChanger::GetColorFromStack (colorchanger.cpp)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/sourceforge.net\/projects\/podofo\/\">podofo<\/a> is a C++ library to work with the PDF file format.<\/p>\n<p>A fuzz on it discovered a null pointer access. The upstream project denies me to open a new ticket. So, I just will forward this on the -users mailing list.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># podofocolor dummy $FILE foo\r\n==18954==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000052302d bp 0x7fc24b8e2000 sp 0x7ffcaaf21810 T0)\r\n==18954==The signal is caused by a READ memory access.\r\n==18954==Hint: address points to the zero page.\r\n    #0 0x52302c in getVtablePrefix \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/ubsan\/ubsan_type_hash_itanium.cc:198\r\n    #1 0x52302c in __ubsan::checkDynamicType(void*, void*, unsigned long) \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/ubsan\/ubsan_type_hash_itanium.cc:221\r\n    #2 0x521082 in HandleDynamicTypeCacheMiss \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/ubsan\/ubsan_handlers_cxx.cc:37\r\n    #3 0x521922 in __ubsan_handle_dynamic_type_cache_miss \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/ubsan\/ubsan_handlers_cxx.cc:87\r\n    #4 0x538eb2 in ColorChanger::GetColorFromStack(int, std::vector&lt;PoDoFo::PdfVariant, std::allocator &gt;&amp;) \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/colorchanger.cpp:430:33\r\n    #5 0x530d50 in ColorChanger::ProcessColor(ColorChanger::EKeywordType, int, std::vector&lt;PoDoFo::PdfVariant, std::allocator &gt;&amp;, GraphicsStack&amp;) \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/colorchanger.cpp:449:28\r\n    #6 0x52c2a9 in ColorChanger::ReplaceColorsInPage(PoDoFo::PdfCanvas*) \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/colorchanger.cpp:214:31\r\n    #7 0x526921 in ColorChanger::start() \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/colorchanger.cpp:120:15\r\n    #8 0x523b8d in main \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/podofocolor.cpp:116:12\r\n    #9 0x7fc2490df78f in __libc_start_main \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289\r\n    #10 0x4300e8 in _start (\/usr\/bin\/podofocolor+0x4300e8)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV \/tmp\/portage\/sys-devel\/llvm-3.9.1-r1\/work\/llvm-3.9.1.src\/projects\/compiler-rt\/lib\/ubsan\/ubsan_type_hash_itanium.cc:198 in getVtablePrefix\r\n==18954==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n0.9.5<\/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 \/>\nCVE-2017-6842<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00217-podofo-nullptr-colorchanger-cpp\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00217-podofo-nullptr-colorchanger-cpp<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-03-01: bug discovered<br \/>\n2017-03-02: bug reported upstream<br \/>\n2017-03-02: blog post about the issue<br \/>\n2017-03-12: CVE assigned<\/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><\/p>\n<blockquote data-secret=\"HIUE1ppgJi\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-colorchangergetcolorfromstack-colorchanger-cpp\/\">podofo: NULL pointer dereference in ColorChanger::GetColorFromStack (colorchanger.cpp)<\/a><\/p><\/blockquote>\n<p><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-colorchangergetcolorfromstack-colorchanger-cpp\/embed\/#?secret=HIUE1ppgJi\" data-secret=\"HIUE1ppgJi\" width=\"600\" height=\"338\" title=\"&#8220;podofo: NULL pointer dereference in ColorChanger::GetColorFromStack (colorchanger.cpp)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: podofo is a C++ library to work with the PDF file format. A fuzz on it discovered a null pointer access. The upstream project denies me to open a new ticket. So, I just will forward this on the &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-colorchangergetcolorfromstack-colorchanger-cpp\/\">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-my","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1398"}],"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=1398"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1398\/revisions"}],"predecessor-version":[{"id":1453,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1398\/revisions\/1453"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}