{"id":970,"date":"2016-12-01T15:26:16","date_gmt":"2016-12-01T13:26:16","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=970"},"modified":"2017-01-16T14:02:29","modified_gmt":"2017-01-16T12:02:29","slug":"libav-multiple-crashes-from-the-undefined-behavior-sanitizer","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2016\/12\/01\/libav-multiple-crashes-from-the-undefined-behavior-sanitizer\/","title":{"rendered":"libav: multiple crashes from the Undefined Behavior Sanitizer"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/libav.org\/\">Libav<\/a> is an open source set of tools for audio and video processing.<\/p>\n<p>A fuzzing on an updated stable releases with the Undefined Behavior Sanitizer enabled, revealed multiple crashes. At the date I&#8217;m releasing this post, upstream didn&#8217;t give a response\/feedback about.<\/p>\n<p>All issues are reproducible with: <\/p>\n<pre><font size=\"2\">avconv -i $FILE -f null -<\/font><\/pre>\n<p>More details about:<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo.c:2381:65: runtime error: left shift of negative value -1<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo.c:2382:65: runtime error: left shift of negative value -1<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo.c:2383:65: runtime error: left shift of negative value -1<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00036-libav-leftshift-mpegvideo\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00036-libav-leftshift-mpegvideo<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9819<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo_motion.c:323:47: runtime error: left shift of negative value -1<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo_motion.c:331:55: runtime error: left shift of negative value -1<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo_motion.c:336:55: runtime error: left shift of negative value -1<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00036-libav-leftshift-mpegvideo\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00036-libav-leftshift-mpegvideo<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9820<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpegvideo_parser.c:91:65: runtime error: signed integer overflow: 28573696 * 400 cannot be represented in type &#8216;int&#8217;<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00037-libav-signedintoverflow-mpegvideo_parser\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00037-libav-signedintoverflow-mpegvideo_parser<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9821<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/mpeg12dec.c:1401:41: runtime error: signed integer overflow: 28573696 * 400 cannot be represented in type &#8216;int&#8217;<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00037-libav-signedintoverflow-mpegvideo_parser\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00037-libav-signedintoverflow-mpegvideo_parser<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9822<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/x86\/mpegvideo.c:53:18: runtime error: index -1 out of bounds for type &#8216;uint8_t [64]&#8217;<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00038-libav-uint8_t64-outofbounds-mpegvideo\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00038-libav-uint8_t64-outofbounds-mpegvideo<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9823<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libswscale\/x86\/swscale.c:189:64: runtime error: signed integer overflow: 65463 * 65537 cannot be represented in type &#8216;int&#8217;<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00039-libav-signedintoverflow-swscale_c\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00039-libav-signedintoverflow-swscale_c<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9824<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libswscale\/utils.c:340:30: runtime error: left shift of negative value -1<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00040-libav-leftshift-utils_c\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00040-libav-leftshift-utils_c<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9825<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/ituh263dec.c:645:34: runtime error: left shift of negative value -16<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00041-libav-leftshift-ituh263dec_c\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00041-libav-leftshift-ituh263dec_c<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-9826<\/p>\n<p>######################################<\/p>\n<p><strong>Affected version \/ Tested on<\/strong>:<br \/>\n11.8<br \/>\n<strong>Output\/failure<\/strong>:<br \/>\n\/tmp\/portage\/media-video\/libav-11.8\/work\/libav-11.8\/libavcodec\/get_bits.h:530:5: runtime error: load of null pointer of type &#8216;int16_t&#8217; (aka &#8216;short&#8217;)<br \/>\n<strong>Commit fix<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Fixed version<\/strong>:<br \/>\nN\/A<br \/>\n<strong>Testcase<\/strong>:<br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00042-libav-loadnullptr-get_bits_h\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00042-libav-loadnullptr-get_bits_h<\/a><br \/>\n<strong>CVE:<\/strong><br \/>\nCVE-2016-8676 (see <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/09\/07\/libav-null-pointer-dereference-in-get_vlc2_get_bits_h\">https:\/\/blogs.gentoo.org\/ago\/2016\/09\/07\/libav-null-pointer-dereference-in-get_vlc2_get_bits_h<\/a><\/p>\n<p><strong>Credit:<\/strong><br \/>\nThese bugs were discovered by Agostino Sarubbo of Gentoo.<\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2016-11-08: bug discovered and reported to upstream<br \/>\n2016-12-01: blog post about the issue<br \/>\n2016-12-05: 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=\"AroF7X6gfg\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2016\/12\/01\/libav-multiple-crashes-from-the-undefined-behavior-sanitizer\/\">libav: multiple crashes from the Undefined Behavior Sanitizer<\/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\/12\/01\/libav-multiple-crashes-from-the-undefined-behavior-sanitizer\/embed\/#?secret=AroF7X6gfg\" data-secret=\"AroF7X6gfg\" width=\"600\" height=\"338\" title=\"&#8220;libav: multiple crashes from the Undefined Behavior Sanitizer&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: Libav is an open source set of tools for audio and video processing. A fuzzing on an updated stable releases with the Undefined Behavior Sanitizer enabled, revealed multiple crashes. At the date I&#8217;m releasing this post, upstream didn&#8217;t give &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2016\/12\/01\/libav-multiple-crashes-from-the-undefined-behavior-sanitizer\/\">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-fE","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/970"}],"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=970"}],"version-history":[{"count":8,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/970\/revisions"}],"predecessor-version":[{"id":1130,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/970\/revisions\/1130"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}