{"id":1280,"date":"2017-02-04T14:16:04","date_gmt":"2017-02-04T12:16:04","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1280"},"modified":"2017-02-04T14:16:04","modified_gmt":"2017-02-04T12:16:04","slug":"pax-utils-dumpelf-out-of-bounds-read-in-dump_notes-dumpelf-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/04\/pax-utils-dumpelf-out-of-bounds-read-in-dump_notes-dumpelf-c\/","title":{"rendered":"pax-utils: dumpelf: out of bounds read in dump_notes (dumpelf.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/gitweb.gentoo.org\/proj\/pax-utils.git\">pax-utils<\/a> is a set of tools that check files for security relevant properties.<\/p>\n<p>A fuzz on dumpelf an out of bounds read. It was reported to vapier which fixed the issue immediately.<br \/>\nUnfortunately I can&#8217;t get a symbolized ASan stacktrace, so I will show only the useful part of both asan and gdb.<br \/>\nThis is not CVE-worthy because of the &#8220;READ of size 1&#8221; in a command-line tool. I&#8217;m sharing it because some distro\/packagers may want to have the patch aboard.<\/p>\n<pre><font size=\"2\"># dumpelf $FILE\r\nunknown-crash on address 0x7fc30f701000 at pc 0x000000520111 bp 0x7ffdc3db8eb0 sp 0x7ffdc3db8ea8\r\nREAD of size 1 at 0x7fc30f701000 thread T0\r\n\r\n(gdb)\r\n#0  dump_notes (B=B@entry=64, memory=memory@entry=0x7ffff7ff428c, memory_end=0x7ffff7ff42ac, elf=0x60d8e0, elf=0x60d8e0) at dumpelf.c:245\r\n#1  0x0000000000405636 in dump_phdr (elf=elf@entry=0x60d8e0, phdr_void=phdr_void@entry=0x7ffff7ff4158, phdr_cnt=phdr_cnt@entry=5) at dumpelf.c:324\r\n#2  0x0000000000401dd9 in dumpelf (file_cnt=0, filename=) at dumpelf.c:91\r\n#3  parseargs (argv=0x7fffffffe1a8, argc=2) at dumpelf.c:557\r\n#4  main (argc=2, argv=0x7fffffffe1a8) at dumpelf.c:566\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.2.2<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/gentoo\/pax-utils\/commit\/10a9643d90a1ba6058a66066803fac6cf43f6917\">https:\/\/github.com\/gentoo\/pax-utils\/commit\/10a9643d90a1ba6058a66066803fac6cf43f6917<\/a><\/p>\n<p><strong>Credit:<\/strong><br \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00142-pax-utils-dumpelf-oob1\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00142-pax-utils-dumpelf-oob1<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-01-30: bug discovered and reported to upstream<br \/>\n2017-02-01: upstream released a patch<br \/>\n2017-02-04: 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\/04\/pax-utils-dumpelf-out-of-bounds-read-in-dump_notes-dumpelf-c<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: pax-utils is a set of tools that check files for security relevant properties. A fuzz on dumpelf an out of bounds read. It was reported to vapier which fixed the issue immediately. Unfortunately I can&#8217;t get a symbolized ASan &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/04\/pax-utils-dumpelf-out-of-bounds-read-in-dump_notes-dumpelf-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-kE","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1280"}],"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=1280"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1280\/revisions"}],"predecessor-version":[{"id":1284,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1280\/revisions\/1284"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}