{"id":496,"date":"2016-09-10T16:56:12","date_gmt":"2016-09-10T14:56:12","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=496"},"modified":"2017-04-10T10:29:44","modified_gmt":"2017-04-10T08:29:44","slug":"autotrace-heap-based-buffer-overflow-in-pstoedit_suffix_table_init-output-pstoedit-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/09\/10\/autotrace-heap-based-buffer-overflow-in-pstoedit_suffix_table_init-output-pstoedit-c\/","title":{"rendered":"autotrace: heap-based buffer overflow in pstoedit_suffix_table_init (output-pstoedit.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/autotrace.sourceforge.net\/\">autotrace<\/a> is a program for converting bitmaps to vector graphics.<\/p>\n<p>If compiled with Address Sanitizer, it shows that <strong>ANY<\/strong> bmp image causes an out-of-bounds write.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># autotrace $FILE\r\n==31756==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61700000ff20 at pc 0x7f11a5538380 bp 0x7ffecc970f90 sp 0x7ffecc970f88                                                      \r\nWRITE of size 8 at 0x61700000ff20 thread T0                                                                                                                                                    \r\n    #0 0x7f11a553837f in pstoedit_suffix_table_init \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/output-pstoedit.c:103:54                                              \r\n    #1 0x7f11a5536544 in pstoedit_suffix_table_lookup_shallow \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/output-pstoedit.c:143:5                                     \r\n    #2 0x7f11a5536544 in output_pstoedit_is_writer \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/output-pstoedit.c:160                                                  \r\n    #3 0x7f11a556020b in at_splines_write \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/autotrace.c:375:7                                                               \r\n    #4 0x4f579b in main \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/main.c:161:3                                                                                      \r\n    #5 0x7f11a460761f 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 0x4196b8 in _init (\/usr\/bin\/autotrace+0x4196b8)                                                                                                                                         \r\n                                                                                                                                                                                               \r\n0x61700000ff21 is located 0 bytes to the right of 673-byte region [0x61700000fc80,0x61700000ff21)                                                                                              \r\nallocated by thread T0 here:                                                                                                                                                                   \r\n    #0 0x4c0c08 in malloc \/var\/tmp\/portage\/sys-devel\/llvm-3.8.1\/work\/llvm-3.8.1.src\/projects\/compiler-rt\/lib\/asan\/asan_malloc_linux.cc:52                                                      \r\n    #1 0x7f11a5538053 in pstoedit_suffix_table_init \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/output-pstoedit.c:87:7                                                \r\n                                                                                                                                                                                               \r\nSUMMARY: AddressSanitizer: heap-buffer-overflow \/var\/tmp\/portage\/media-gfx\/autotrace-0.31.1-r7\/work\/autotrace-0.31.1\/output-pstoedit.c:103:54 in pstoedit_suffix_table_init                    \r\nShadow bytes around the buggy address:                                                                                                                                                         \r\n  0x0c2e7fff9f90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              \r\n  0x0c2e7fff9fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              \r\n  0x0c2e7fff9fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              \r\n  0x0c2e7fff9fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              \r\n  0x0c2e7fff9fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                              \r\n=&gt;0x0c2e7fff9fe0: 00 00 00 00[01]fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\n  0x0c2e7fff9ff0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\n  0x0c2e7fffa000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\n  0x0c2e7fffa010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\n  0x0c2e7fffa020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\n  0x0c2e7fffa030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa                                                                                                                              \r\nShadow byte legend (one shadow byte represents 8 application bytes):\r\n  Addressable:           00\r\n  Partially addressable: 01 02 03 04 05 06 07 \r\n  Heap left redzone:       fa\r\n  Heap right redzone:      fb\r\n  Freed heap region:       fd\r\n  Stack left redzone:      f1\r\n  Stack mid redzone:       f2\r\n  Stack right redzone:     f3\r\n  Stack partial redzone:   f4\r\n  Stack after return:      f5\r\n  Stack use after scope:   f8\r\n  Global redzone:          f9\r\n  Global init order:       f6\r\n  Poisoned by user:        f7\r\n  Container overflow:      fc\r\n  Array cookie:            ac\r\n  Intra object redzone:    bb\r\n  ASan internal:           fe\r\n  Left alloca redzone:     ca\r\n  Right alloca redzone:    cb\r\n==31756==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n0.31.1<\/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-2016-7392<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2016-09-10: bug discovered<br \/>\n2016-09-10: bug reported to upstream<br \/>\n2016-09-10: blog post about the issue<br \/>\n2016-09-10: CVE assigned<\/p>\n<p><strong>Note:<\/strong><br \/>\nThis bug was found with <a href=\"https:\/\/github.com\/google\/sanitizers\/wiki\/AddressSanitizer\">Address Sanitizer<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"SgCJhV8gQG\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/09\/10\/autotrace-heap-based-buffer-overflow-in-pstoedit_suffix_table_init-output-pstoedit-c\/\">autotrace: heap-based buffer overflow in pstoedit_suffix_table_init (output-pstoedit.c)<\/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\/09\/10\/autotrace-heap-based-buffer-overflow-in-pstoedit_suffix_table_init-output-pstoedit-c\/embed\/#?secret=SgCJhV8gQG\" data-secret=\"SgCJhV8gQG\" width=\"600\" height=\"338\" title=\"&#8220;autotrace: heap-based buffer overflow in pstoedit_suffix_table_init (output-pstoedit.c)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: autotrace is a program for converting bitmaps to vector graphics. If compiled with Address Sanitizer, it shows that ANY bmp image causes an out-of-bounds write. The complete ASan output: # autotrace $FILE ==31756==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61700000ff20 at &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/09\/10\/autotrace-heap-based-buffer-overflow-in-pstoedit_suffix_table_init-output-pstoedit-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-80","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/496"}],"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=496"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/496\/revisions"}],"predecessor-version":[{"id":1632,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/496\/revisions\/1632"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}