{"id":2178,"date":"2017-09-08T17:07:29","date_gmt":"2017-09-08T15:07:29","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=2178"},"modified":"2017-09-13T22:59:50","modified_gmt":"2017-09-13T20:59:50","slug":"mp3gain-global-buffer-overflow-in-iii_i_stereo-mpglibdbllayer3-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_i_stereo-mpglibdbllayer3-c\/","title":{"rendered":"mp3gain: global buffer overflow in III_i_stereo (mpglibDBL\/layer3.c)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"http:\/\/mp3gain.sourceforge.net\/\">mp3gain<\/a> is a program to analyze and adjust MP3 files to same volume.<\/p>\n<p>The fuzz was done via the aacgain command-line tool which uses mp3gain which bundles an old-modified version of mpg123 called mpglibDBL.<br \/>\nThe upstream project seems to be dead, so the issue wasn\u2019t communicated to them.<\/p>\n<p>The complete ASan output of the issue:<\/p>\n<pre><font size=\"2\"># aacgain -f $FILE\r\n==20037==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000010803e0 at pc 0x0000008dde6c bp 0x7fff0aee7020 sp 0x7fff0aee7018                                                                       \r\nREAD of size 8 at 0x0000010803e0 thread T0                                                                                                                                                                        \r\n    #0 0x8dde6b in III_i_stereo \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:1076                                                                                         \r\n    #1 0x8dde6b in do_layer3 \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:1661                                                                                            \r\n    #2 0x8ac2f9 in decodeMP3 \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/interface.c:643                                                                                          \r\n    #3 0x43e767 in main \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mp3gain.c:2262                                                                                                          \r\n    #4 0x7f756ace0680 in __libc_start_main (\/lib64\/libc.so.6+0x20680)                                                                                                                                             \r\n    #5 0x4426c8 in _start (\/usr\/bin\/aacgain+0x4426c8)                                                                                                                                                             \r\n                                                                                                                                                                                                                  \r\n0x0000010803e0 is located 32 bytes to the left of global variable 'pow2_1' defined in 'layer3.c:109:27' (0x1080400) of size 256                                                                                   \r\n0x0000010803e0 is located 0 bytes to the right of global variable 'pow1_2' defined in 'layer3.c:109:41' (0x10802e0) of size 256                                                                                   \r\nSUMMARY: AddressSanitizer: global-buffer-overflow \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:1076 in III_i_stereo                                                       \r\nShadow bytes around the buggy address:                                                                                                                                                                            \r\n  0x000080208020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00                                                                                                                                                 \r\n  0x000080208030: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00\r\n  0x000080208040: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080208050: 00 00 00 00 00 00 00 00 f9 f9 f9 f9 00 00 00 00\r\n  0x000080208060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n=&gt;0x000080208070: 00 00 00 00 00 00 00 00 00 00 00 00[f9]f9 f9 f9\r\n  0x000080208080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080208090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0000802080a0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0000802080b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0000802080c0: 00 00 00 00 f9 f9 f9 f9 00 00 00 00 00 00 00 00\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==20037==ABORTING\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.5.2<\/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-14410<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00353-aacgain-globaloverflow-III_i_stereo\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00353-aacgain-globaloverflow-III_i_stereo<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-08-28: bug discovered<br \/>\n2017-09-08: blog post about the issue<br \/>\n2017-09-13: 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>.<br \/>\nThis bug was identified with bare metal servers donated by <a href=\"https:\/\/www.packet.net\/\">Packet<\/a>. This work is also supported by the <a href=\"https:\/\/www.coreinfrastructure.org\">Core Infrastructure Initiative<\/a>.<\/p>\n<p><strong>Permalink:<\/strong><\/p>\n<blockquote data-secret=\"FENfORxqIT\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_i_stereo-mpglibdbllayer3-c\/\">mp3gain: global buffer overflow in III_i_stereo (mpglibDBL\/layer3.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\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_i_stereo-mpglibdbllayer3-c\/embed\/#?secret=FENfORxqIT\" data-secret=\"FENfORxqIT\" width=\"600\" height=\"338\" title=\"&#8220;mp3gain: global buffer overflow in III_i_stereo (mpglibDBL\/layer3.c)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: mp3gain is a program to analyze and adjust MP3 files to same volume. The fuzz was done via the aacgain command-line tool which uses mp3gain which bundles an old-modified version of mpg123 called mpglibDBL. The upstream project seems to &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_i_stereo-mpglibdbllayer3-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-z8","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2178"}],"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=2178"}],"version-history":[{"count":7,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2178\/revisions"}],"predecessor-version":[{"id":2256,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2178\/revisions\/2256"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=2178"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=2178"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=2178"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}