{"id":1376,"date":"2017-02-20T17:03:05","date_gmt":"2017-02-20T15:03:05","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=1376"},"modified":"2017-03-13T11:07:32","modified_gmt":"2017-03-13T09:07:32","slug":"audiofile-divide-by-zero-in-blockcodecreset1-blockcodec-cpp","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-divide-by-zero-in-blockcodecreset1-blockcodec-cpp\/","title":{"rendered":"audiofile: divide-by-zero in BlockCodec::reset1 (BlockCodec.cpp)"},"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 a division by zero.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># sfconvert @@ out.mp3 format aiff\r\n==3538==ERROR: AddressSanitizer: FPE on unknown address 0x7f86a8cffe14 (pc 0x7f86a8cffe14 bp 0x7ffe41d2ae00 sp 0x7ffe41d2adf0 T0)                                                                                                                                              \r\n    #0 0x7f86a8cffe13 in BlockCodec::reset1() \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/libaudiofile\/modules\/BlockCodec.cpp:74:61                                                                                                                        \r\n    #1 0x7f86a8d0b794 in ModuleState::reset(_AFfilehandle*, Track*) \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/libaudiofile\/modules\/ModuleState.cpp:218:9                                                                                                 \r\n    #2 0x7f86a8d0b794 in ModuleState::setup(_AFfilehandle*, Track*) \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/libaudiofile\/modules\/ModuleState.cpp:190                                                                                                   \r\n    #3 0x7f86a8ced43c in afGetFrameCount \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/libaudiofile\/format.cpp:205:41                                                                                                                                        \r\n    #4 0x50bb5c in copyaudiodata \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/sfcommands\/sfconvert.c:329:29                                                                                                                                                 \r\n    #5 0x50b050 in main \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/sfcommands\/sfconvert.c:248:17                                                                                                                                                          \r\n    #6 0x7f86a7dbe78f in __libc_start_main \/tmp\/portage\/sys-libs\/glibc-2.23-r3\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289                                                                                                                                                     \r\n    #7 0x419f48 in _init (\/usr\/bin\/sfconvert+0x419f48)                                                                                                                                                                                                                         \r\n                                                                                                                                                                                                                                                                               \r\nAddressSanitizer can not provide additional info.                                                                                                                                                                                                                              \r\nSUMMARY: AddressSanitizer: FPE \/tmp\/portage\/media-libs\/audiofile-0.3.6-r1\/work\/audiofile-0.3.6\/libaudiofile\/modules\/BlockCodec.cpp:74:61 in BlockCodec::reset1()                                                                                                               \r\n==3538==ABORTING\r\n<\/font><\/pre>\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 \/>\nThis bug was discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>CVE:<\/strong><br \/>\nCVE-2017-6835<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00189-audiofile-fpe-BlockCodec-reset1\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00189-audiofile-fpe-BlockCodec-reset1<\/a><\/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 \/>\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=\"eUBhvxSBpW\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-divide-by-zero-in-blockcodecreset1-blockcodec-cpp\/\">audiofile: divide-by-zero in BlockCodec::reset1 (BlockCodec.cpp)<\/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-divide-by-zero-in-blockcodecreset1-blockcodec-cpp\/embed\/#?secret=eUBhvxSBpW\" data-secret=\"eUBhvxSBpW\" width=\"600\" height=\"338\" title=\"&#8220;audiofile: divide-by-zero in BlockCodec::reset1 (BlockCodec.cpp)&#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 a division by zero. The complete ASan output: # sfconvert @@ out.mp3 format aiff ==3538==ERROR: AddressSanitizer: FPE on unknown &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/02\/20\/audiofile-divide-by-zero-in-blockcodecreset1-blockcodec-cpp\/\">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-mc","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1376"}],"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=1376"}],"version-history":[{"count":3,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1376\/revisions"}],"predecessor-version":[{"id":1438,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/1376\/revisions\/1438"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=1376"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=1376"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=1376"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}