{"id":882,"date":"2016-11-09T16:30:40","date_gmt":"2016-11-09T14:30:40","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=882"},"modified":"2017-04-29T15:44:57","modified_gmt":"2017-04-29T13:44:57","slug":"libming-listmp3-divide-by-zero-in-printmp3headers-listmp3-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/09\/libming-listmp3-divide-by-zero-in-printmp3headers-listmp3-c\/","title":{"rendered":"libming: listmp3: divide-by-zero in printMP3Headers (listmp3.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/www.libming.org\">libming<\/a> is a Flash (SWF) output library. It can be used from PHP, Perl, Ruby, Python, C, C++, Java, and probably more on the way..<\/p>\n<p>A fuzzing revealed a divide by zero in listmp3. The bug does not reside in any shared object but if you have a web application that calls directly the listmp3 binary to parse untrusted mp3, then you are affected.<\/p>\n<p>The complete ASan output:<\/p>\n<pre><font size=\"2\"># listmp3 $FILE\r\nASAN:DEADLYSIGNAL\r\n=================================================================\r\n==29561==ERROR: AddressSanitizer: FPE on unknown address 0x0000004f19e8 (pc 0x0000004f19e8 bp 0x000000000000 sp 0x7ffdf0ab6340 T0)\r\n    #0 0x4f19e7 in printMP3Headers \/var\/tmp\/portage\/media-libs\/ming-0.4.7\/work\/ming-0_4_7\/util\/listmp3.c:172:54\r\n    #1 0x4f1bee in main \/var\/tmp\/portage\/media-libs\/ming-0.4.7\/work\/ming-0_4_7\/util\/listmp3.c:191:3\r\n    #2 0x7f49407a361f in __libc_start_main \/var\/tmp\/portage\/sys-libs\/glibc-2.22-r4\/work\/glibc-2.22\/csu\/libc-start.c:289\r\n    #3 0x418ae8 in getenv (\/usr\/bin\/listmp3+0x418ae8)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: FPE \/var\/tmp\/portage\/media-libs\/ming-0.4.7\/work\/ming-0_4_7\/util\/listmp3.c:172:54 in printMP3Headers\r\n==29561==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n0.4.7<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\n0.4.8<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/libming\/libming\/commit\/b0704f80ef2ec1507043df77d6519d18cf017e16\">https:\/\/github.com\/libming\/libming\/commit\/b0704f80ef2ec1507043df77d6519d18cf017e16<\/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-9265<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00045-libming-fpe-printMP3Headers\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00045-libming-fpe-printMP3Headers<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2016-08-13: bug discovered<br \/>\n2016-10-20: bug reported to upstream<br \/>\n2016-11-09: blog post about the issue<br \/>\n2016-11-10: CVE assigned<br \/>\n2017-01-30: upstream released a patch<br \/>\n2017-04-07: upstream released 0.4.8<\/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=\"xDVCJsGq7Z\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/11\/09\/libming-listmp3-divide-by-zero-in-printmp3headers-listmp3-c\/\">libming: listmp3: divide-by-zero in printMP3Headers (listmp3.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\/11\/09\/libming-listmp3-divide-by-zero-in-printmp3headers-listmp3-c\/embed\/#?secret=xDVCJsGq7Z\" data-secret=\"xDVCJsGq7Z\" width=\"600\" height=\"338\" title=\"&#8220;libming: listmp3: divide-by-zero in printMP3Headers (listmp3.c)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: libming is a Flash (SWF) output library. It can be used from PHP, Perl, Ruby, Python, C, C++, Java, and probably more on the way.. A fuzzing revealed a divide by zero in listmp3. The bug does not reside &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/11\/09\/libming-listmp3-divide-by-zero-in-printmp3headers-listmp3-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-ee","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/882"}],"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=882"}],"version-history":[{"count":7,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/882\/revisions"}],"predecessor-version":[{"id":1693,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/882\/revisions\/1693"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=882"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=882"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}