{"id":2168,"date":"2017-09-08T16:47:31","date_gmt":"2017-09-08T14:47:31","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=2168"},"modified":"2017-09-13T23:00:08","modified_gmt":"2017-09-13T21:00:08","slug":"mp3gain-global-buffer-overflow-in-iii_dequantize_sample-mpglibdbllayer3-c","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_dequantize_sample-mpglibdbllayer3-c\/","title":{"rendered":"mp3gain: global buffer overflow in III_dequantize_sample (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==23791==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00000107ff80 at pc 0x0000008e2acc bp 0x7fff34f7d100 sp 0x7fff34f7d0f8\r\nWRITE of size 8 at 0x00000107ff80 thread T0\r\n    #0 0x8e2acb in III_dequantize_sample \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:779\r\n    #1 0x8e2acb in do_layer3 \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:1646\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 0x7f36927b3680 in __libc_start_main (\/lib64\/libc.so.6+0x20680)\r\n    #5 0x4426c8 in _start (\/usr\/bin\/aacgain+0x4426c8)\r\n\r\n0x00000107ff80 is located 32 bytes to the left of global variable 'sideinfo' defined in 'layer3.c:1521:21' (0x107ffa0) of size 488\r\n0x00000107ff80 is located 0 bytes to the right of global variable 'hybridIn' defined in 'layer3.c:1612:17' (0x107db80) of size 9216\r\nSUMMARY: AddressSanitizer: global-buffer-overflow \/var\/tmp\/portage\/media-sound\/aacgain-1.9\/work\/aacgain-1.9\/mp3gain\/mpglibDBL\/layer3.c:779 in III_dequantize_sample\r\nShadow bytes around the buggy address:\r\n  0x000080207fa0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080207fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080207fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080207fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080207fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n=&gt;0x000080207ff0:[f9]f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080208000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x000080208010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\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\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==23791==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-14409<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00350-aacgain-globaloverflow-III_dequantize_sample\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00350-aacgain-globaloverflow-III_dequantize_sample<\/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=\"NB2NsZ0ye1\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/09\/08\/mp3gain-global-buffer-overflow-in-iii_dequantize_sample-mpglibdbllayer3-c\/\">mp3gain: global buffer overflow in III_dequantize_sample (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_dequantize_sample-mpglibdbllayer3-c\/embed\/#?secret=NB2NsZ0ye1\" data-secret=\"NB2NsZ0ye1\" width=\"600\" height=\"338\" title=\"&#8220;mp3gain: global buffer overflow in III_dequantize_sample (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_dequantize_sample-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-yY","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2168"}],"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=2168"}],"version-history":[{"count":6,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2168\/revisions"}],"predecessor-version":[{"id":2255,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2168\/revisions\/2255"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=2168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=2168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=2168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}