{"id":431,"date":"2016-08-08T16:51:20","date_gmt":"2016-08-08T14:51:20","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=431"},"modified":"2016-10-16T11:19:40","modified_gmt":"2016-10-16T09:19:40","slug":"potrace-divide-by-zero-in-bm_new-bitmap-h","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/08\/08\/potrace-divide-by-zero-in-bm_new-bitmap-h\/","title":{"rendered":"potrace: divide-by-zero in bm_new (bitmap.h)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/potrace.sourceforge.net\/\">potrace<\/a> is a utility that transforms bitmaps into vector graphics.<\/p>\n<p>A crafted image (bmp) revealed, through a fuzz testing, the presence of a division by zero.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># potrace $FILE.bmp\r\nASAN:DEADLYSIGNAL\r\n=================================================================\r\n==25102==ERROR: AddressSanitizer: FPE on unknown address 0x000000508d52 (pc 0x000000508d52 bp 0x7ffc381edff0 sp 0x7ffc381ede20 T0)\r\n    #0 0x508d51 in bm_new \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/bitmap.h:63:24\r\n    #1 0x508d51 in bm_readbody_bmp \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/bitmap_io.c:548\r\n    #2 0x508d51 in bm_read \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/bitmap_io.c:129\r\n    #3 0x4fe12d in process_file \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/main.c:1056:9\r\n    #4 0x4f82af in main \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/main.c:1212:7\r\n    #5 0x7f8d6729e61f in __libc_start_main \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/csu\/libc-start.c:289\r\n    #6 0x419018 in getenv (\/usr\/bin\/potrace+0x419018)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: FPE \/tmp\/portage\/media-gfx\/potrace-1.12\/work\/potrace-1.12\/src\/bitmap.h:63:24 in bm_new\r\n==25102==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.12<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\n1.13<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\nThere is no public git\/svn repository, If you need the single patches, feel free to ask.<\/p>\n<p><strong>Credit:<\/strong><br \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>CVE:<\/strong><br \/>\nCVE-2016-8697<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2015-07-04: bug discovered<br \/>\n2015-07-05: bug reported privately to upstream<br \/>\n2015-10-22: upstream realeased 1.13<br \/>\n2016-08-08: blog post about the issue<br \/>\n2016-10-16: 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=\"aHWiJTbmEw\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/08\/08\/potrace-divide-by-zero-in-bm_new-bitmap-h\/\">potrace: divide-by-zero in bm_new (bitmap.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\/2016\/08\/08\/potrace-divide-by-zero-in-bm_new-bitmap-h\/embed\/#?secret=aHWiJTbmEw\" data-secret=\"aHWiJTbmEw\" width=\"600\" height=\"338\" title=\"&#8220;potrace: divide-by-zero in bm_new (bitmap.h)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: potrace is a utility that transforms bitmaps into vector graphics. A crafted image (bmp) revealed, through a fuzz testing, the presence of a division by zero. The complete ASan output: # potrace $FILE.bmp ASAN:DEADLYSIGNAL ================================================================= ==25102==ERROR: AddressSanitizer: FPE on &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/08\/08\/potrace-divide-by-zero-in-bm_new-bitmap-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-6X","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/431"}],"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=431"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/431\/revisions"}],"predecessor-version":[{"id":699,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/431\/revisions\/699"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}