{"id":2220,"date":"2017-09-14T12:35:44","date_gmt":"2017-09-14T10:35:44","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=2220"},"modified":"2017-09-22T09:09:11","modified_gmt":"2017-09-22T07:09:11","slug":"bento4-null-pointer-dereference-in-ap4_atomsampletablegetsample-ap4atomsampletable-cpp","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-null-pointer-dereference-in-ap4_atomsampletablegetsample-ap4atomsampletable-cpp\/","title":{"rendered":"bento4: NULL pointer dereference in AP4_AtomSampleTable::GetSample (Ap4AtomSampleTable.cpp)"},"content":{"rendered":"<p><strong>Description<\/strong>:<br \/>\n<a href=\"https:\/\/www.bento4.com\/\">bento4<\/a> is a fast, modern, open source C++ toolkit for all your MP4 and MPEG DASH media format needs.<\/p>\n<p>The complete ASan output of the issue:<\/p>\n<pre><font size=\"2\"># mp42aac $FILE out.aac\r\nASAN:DEADLYSIGNAL\r\n=================================================================\r\n==6365==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 (pc 0x0000005cf94c bp 0x7fff5857d580 sp 0x7fff5857d4c0 T0)\r\n==6365==The signal is caused by a READ memory access.\r\n==6365==Hint: address points to the zero page.\r\n    #0 0x5cf94b in AP4_AtomSampleTable::GetSample(unsigned int, AP4_Sample&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomSampleTable.cpp\r\n    #1 0x58d158 in AP4_Track::GetSample(unsigned int, AP4_Sample&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4Track.cpp:435:43\r\n    #2 0x58d158 in AP4_Track::ReadSample(unsigned int, AP4_Sample&amp;, AP4_DataBuffer&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4Track.cpp:469\r\n    #3 0x5430ad in WriteSamples(AP4_Track*, AP4_SampleDescription*, AP4_ByteStream*) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Apps\/Mp42Aac\/Mp42Aac.cpp:192:12\r\n    #4 0x5430ad in main \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Apps\/Mp42Aac\/Mp42Aac.cpp:274\r\n    #5 0x7f41deb72680 in __libc_start_main \/var\/tmp\/portage\/sys-libs\/glibc-2.23-r4\/work\/glibc-2.23\/csu\/..\/csu\/libc-start.c:289\r\n    #6 0x44f3f8 in _start (\/usr\/bin\/mp42aac+0x44f3f8)\r\n\r\nAddressSanitizer can not provide additional info.\r\nSUMMARY: AddressSanitizer: SEGV \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomSampleTable.cpp in AP4_AtomSampleTable::GetSample(unsigned int, AP4_Sample&amp;)\r\n==6365==ABORTING\r\nAudio Track:\r\n  duration: 7848 ms\r\n  sample count: 169\r\n<\/font><\/pre>\n<p><strong>Affected version:<\/strong><br \/>\n1.5.0-617<\/p>\n<p><strong>Fixed version:<\/strong><br \/>\nN\/A<\/p>\n<p><strong>Commit fix:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/axiomatic-systems\/Bento4\/commit\/2f267f89f957088197f4b1fc254632d1645b415d\">https:\/\/github.com\/axiomatic-systems\/Bento4\/commit\/2f267f89f957088197f4b1fc254632d1645b415d<\/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-14640<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00337-bento4-NULLptr-AP4_AtomSampleTable_GetSample\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00337-bento4-NULLptr-AP4_AtomSampleTable_GetSample<\/a><\/p>\n<p><strong>Timeline:<\/strong><br \/>\n2017-09-08: bug discovered and reported to upstream<br \/>\n2017-09-14: blog post about the issue<br \/>\n2017-09-21: 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=\"Zusz92Y3d1\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-null-pointer-dereference-in-ap4_atomsampletablegetsample-ap4atomsampletable-cpp\/\">bento4: NULL pointer dereference in AP4_AtomSampleTable::GetSample (Ap4AtomSampleTable.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\/09\/14\/bento4-null-pointer-dereference-in-ap4_atomsampletablegetsample-ap4atomsampletable-cpp\/embed\/#?secret=Zusz92Y3d1\" data-secret=\"Zusz92Y3d1\" width=\"600\" height=\"338\" title=\"&#8220;bento4: NULL pointer dereference in AP4_AtomSampleTable::GetSample (Ap4AtomSampleTable.cpp)&#8221; &#8212; agostino&#039;s blog\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Description: bento4 is a fast, modern, open source C++ toolkit for all your MP4 and MPEG DASH media format needs. The complete ASan output of the issue: # mp42aac $FILE out.aac ASAN:DEADLYSIGNAL ================================================================= ==6365==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000000 &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-null-pointer-dereference-in-ap4_atomsampletablegetsample-ap4atomsampletable-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-zO","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2220"}],"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=2220"}],"version-history":[{"count":5,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2220\/revisions"}],"predecessor-version":[{"id":2289,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2220\/revisions\/2289"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=2220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=2220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=2220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}