{"id":1396,"date":"2017-03-02T18:24:20","date_gmt":"2017-03-02T16:24:20","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1396"},"modified":"2017-03-13T11:57:30","modified_gmt":"2017-03-13T09:57:30","slug":"podofo-null-pointer-dereference-in-graphicsstacktgraphicsstackelementtgraphicsstackelement-graphicsstack-h","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-graphicsstacktgraphicsstackelementtgraphicsstackelement-graphicsstack-h\/","title":{"rendered":"podofo: NULL pointer dereference in GraphicsStack::TGraphicsStackElement::~TGraphicsStackElement (graphicsstack.h)"},"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 dereference. 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==7677==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x00000054b701 bp 0x7ffe64ec7cb0 sp 0x7ffe64ec7c80 T0)\r\n==7677==The signal is caused by a READ memory access.\r\n==7677==Hint: address points to the zero page.\r\n    #0 0x54b700 in GraphicsStack::TGraphicsStackElement::~TGraphicsStackElement() \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/graphicsstack.h:29:11\r\n    #1 0x55b772 in std::deque&lt;GraphicsStack::TGraphicsStackElement, std::allocator &gt;::pop_back() \/usr\/lib\/gcc\/x86_64-pc-linux-gnu\/4.9.4\/include\/g++-v4\/bits\/stl_deque.h:1459:4\r\n    #2 0x52c84d in ColorChanger::ReplaceColorsInPage(PoDoFo::PdfCanvas*) \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/colorchanger.cpp:190:35\r\n    #3 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    #4 0x523b8d in main \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/podofocolor.cpp:116:12\r\n    #5 0x7fc9a444f78f in __libc_start_main \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289\r\n    #6 0x4300e8 in _start (\/usr\/bin\/podofocolor+0x4300e8)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV \/tmp\/portage\/app-text\/podofo-0.9.5\/work\/podofo-0.9.5\/tools\/podofocolor\/graphicsstack.h:29:11 in GraphicsStack::TGraphicsStackElement::~TGraphicsStackElement()\r\n==7677==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-6841<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00216-podofo-nullptr-graphicsstack-h\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00216-podofo-nullptr-graphicsstack-h<\/a>                                                              <\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-03-01: bug discovered<br \/>\n2017-03-02: bug reported to 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=\"VjYQ8fWGLG\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/03\/02\/podofo-null-pointer-dereference-in-graphicsstacktgraphicsstackelementtgraphicsstackelement-graphicsstack-h\/\">podofo: NULL pointer dereference in GraphicsStack::TGraphicsStackElement::~TGraphicsStackElement (graphicsstack.h)<\/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-graphicsstacktgraphicsstackelementtgraphicsstackelement-graphicsstack-h\/embed\/#?secret=VjYQ8fWGLG\" data-secret=\"VjYQ8fWGLG\" width=\"600\" height=\"338\" title=\"&#8220;podofo: NULL pointer dereference in GraphicsStack::TGraphicsStackElement::~TGraphicsStackElement (graphicsstack.h)&#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 dereference. 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-graphicsstacktgraphicsstackelementtgraphicsstackelement-graphicsstack-h\/\">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-mw","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1396"}],"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=1396"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1396\/revisions"}],"predecessor-version":[{"id":1452,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1396\/revisions\/1452"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1396"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1396"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1396"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}