{"id":1381,"date":"2017-02-20T18:04:05","date_gmt":"2017-02-20T16:04:05","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1381"},"modified":"2017-03-13T11:07:36","modified_gmt":"2017-03-13T09:07:36","slug":"audiofile-multiple-ubsan-crashes","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-multiple-ubsan-crashes\/","title":{"rendered":"audiofile: multiple ubsan crashes"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/www.68k.org\/~michael\/audiofile\/\">audiofile<\/a> is a C-based library for reading and writing audio files in many common formats.<\/p>\n<p>A fuzz on it discovered multiple crashes because of undefined behavior.<\/p>\n<p>The complete UBsan output:<\/p>\n<pre><font size=\"2\"># sfconvert @@ out.mp3 format aiff\r\n\/tmp\/portage\/media-libs\/audiofile-0.3.6-r3\/work\/audiofile-0.3.6\/libaudiofile\/WAVE.cpp:289:14: runtime error: index 256 out of bounds for type 'int16_t [256][2]'\r\n\/tmp\/portage\/media-libs\/audiofile-0.3.6-r3\/work\/audiofile-0.3.6\/libaudiofile\/WAVE.cpp:290:14: runtime error: index 256 out of bounds for type 'int16_t [256][2]'\r\n<\/font><\/pre>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00191-audiofile-indexoob\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00191-audiofile-indexoob<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2017-6837<\/p>\n<p>##########################################<\/p>\n<pre><font size=\"2\"># sfconvert @@ out.mp3 format aiff\r\n\/tmp\/portage\/media-libs\/audiofile-0.3.6-r3\/work\/audiofile-0.3.6\/sfcommands\/sfconvert.c:327:42: runtime error: signed integer overflow: 65536 * 252936 cannot be represented in type 'int'\r\n<\/font><\/pre>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00192-audiofile-signintoverflow-sfconvert\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00192-audiofile-signintoverflow-sfconvert<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2017-6838<\/p>\n<p>##########################################<\/p>\n<pre><font size=\"2\"># sfconvert @@ out.mp3 format aiff\r\n\/tmp\/portage\/media-libs\/audiofile-0.3.6-r3\/work\/audiofile-0.3.6\/libaudiofile\/modules\/MSADPCM.cpp:115:27: runtime error: signed integer overflow: 5512570 * 409 cannot be represented in type 'int'\r\n<\/font><\/pre>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00193-audiofile-signintoverflow-MSADPCM\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00193-audiofile-signintoverflow-MSADPCM<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2017-6839<\/p>\n<p>##########################################<\/p>\n<p><strong>Affected version:<\/strong><br \/>\n0.3.6<\/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 \/>\nThese bugs were discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-02-20: bug discovered and reported to upstream<br \/>\n2017-02-20: blog post about the issue<br \/>\n2017-03-12: CVE assigned<\/p>\n<p><strong>Note:<\/strong><br \/>\nThese bugs were found with <a href=\"http:\/\/lcamtuf.coredump.cx\/afl\">American Fuzzy Lop<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"jSl546Lv7Q\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-multiple-ubsan-crashes\/\">audiofile: multiple ubsan crashes<\/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\/02\/20\/audiofile-multiple-ubsan-crashes\/embed\/#?secret=jSl546Lv7Q\" data-secret=\"jSl546Lv7Q\" width=\"600\" height=\"338\" title=\"&#8220;audiofile: multiple ubsan crashes&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: audiofile is a C-based library for reading and writing audio files in many common formats. A fuzz on it discovered multiple crashes because of undefined behavior. The complete UBsan output: # sfconvert @@ out.mp3 format aiff \/tmp\/portage\/media-libs\/audiofile-0.3.6-r3\/work\/audiofile-0.3.6\/libaudiofile\/WAVE.cpp:289:14: runtime error: &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-multiple-ubsan-crashes\/\">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-mh","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1381"}],"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=1381"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1381\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1381\/revisions\/1440"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}