{"id":2225,"date":"2017-09-14T12:39:00","date_gmt":"2017-09-14T10:39:00","guid":{"rendered":"http:\/\/blogs.gentoo.org\/ago\/?p=2225"},"modified":"2017-09-22T09:15:21","modified_gmt":"2017-09-22T07:15:21","slug":"bento4-heap-based-buffer-overflow-in-ap4_databuffersetdata-ap4databuffer-cpp","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-heap-based-buffer-overflow-in-ap4_databuffersetdata-ap4databuffer-cpp\/","title":{"rendered":"bento4: heap-based buffer overflow in AP4_DataBuffer::SetData (Ap4DataBuffer.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\n==20986==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000000174 at pc 0x0000004ee515 bp 0x7ffd0b8395f0 sp 0x7ffd0b838da0                                                                         \r\nREAD of size 65509 at 0x606000000174 thread T0                                                                                                                                                                    \r\n    #0 0x4ee514 in __asan_memcpy \/var\/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.1\/work\/compiler-rt-4.0.1.src\/lib\/asan\/asan_interceptors.cc:453                                                              \r\n    #1 0x54de2b in AP4_DataBuffer::SetData(unsigned char const*, unsigned int) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4DataBuffer.cpp:175:5                                                                      \r\n    #2 0x5d4a83 in AP4_AvccAtom::AP4_AvccAtom(unsigned int, unsigned char const*) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AvccAtom.cpp:165:32                                                                    \r\n    #3 0x5d1b6b in AP4_AvccAtom::Create(unsigned int, AP4_ByteStream&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AvccAtom.cpp:95:16                                                                                \r\n    #4 0x5cb2e2 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:477:20             \r\n    #5 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14                                        \r\n    #6 0x60c29f in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12                                       \r\n    #7 0x575855 in AP4_SampleEntry::Read(AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:115:9                                                                        \r\n    #8 0x57d624 in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:742:5                     \r\n    #9 0x57d624 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:994                             \r\n    #10 0x5cbf58 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:305:24            \r\n    #11 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14                                       \r\n    #12 0x586a2c in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4StsdAtom.cpp:100:13                         \r\n    #13 0x58566f in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4StsdAtom.cpp:56:16                                                             \r\n    #14 0x5ca71c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:422:20            \r\n    #15 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14                                       \r\n    #16 0x60c29f in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12                                      \r\n    #17 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #18 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #19 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #20 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #21 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #22 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #23 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #24 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #25 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #26 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #27 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #28 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #29 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #30 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #31 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #32 0x60c099 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #33 0x58e6ed in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4TrakAtom.cpp:165:5\r\n    #34 0x5c8e3b in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4TrakAtom.h:58:20\r\n    #35 0x5c8e3b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:377\r\n    #36 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #37 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #38 0x60c099 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #39 0x5521b0 in AP4_MoovAtom::AP4_MoovAtom(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4MoovAtom.cpp:79:5\r\n    #40 0x5cad1d in AP4_MoovAtom::Create(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4MoovAtom.h:56:20\r\n    #41 0x5cad1d in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:357\r\n    #42 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #43 0x5c75c0 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:150:12\r\n    #44 0x54ea2c in AP4_File::ParseStream(AP4_ByteStream&amp;, AP4_AtomFactory&amp;, bool) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4File.cpp:104:12\r\n    #45 0x54f0fa in AP4_File::AP4_File(AP4_ByteStream&amp;, bool) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4File.cpp:78:5\r\n    #46 0x542552 in main \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Apps\/Mp42Aac\/Mp42Aac.cpp:242:32\r\n    #47 0x7f1552e11680 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    #48 0x44f3f8 in _start (\/usr\/bin\/mp42aac+0x44f3f8)\r\n\r\n0x606000000174 is located 0 bytes to the right of 52-byte region [0x606000000140,0x606000000174)\r\nallocated by thread T0 here:\r\n    #0 0x53dfb0 in operator new[](unsigned long) \/var\/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.1\/work\/compiler-rt-4.0.1.src\/lib\/asan\/asan_new_delete.cc:84\r\n    #1 0x54c887 in AP4_DataBuffer::AP4_DataBuffer(unsigned int) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4DataBuffer.cpp:55:16\r\n    #2 0x5d1690 in AP4_AvccAtom::Create(unsigned int, AP4_ByteStream&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AvccAtom.cpp:69:20\r\n    #3 0x5cb2e2 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:477:20\r\n    #4 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #5 0x60c29f in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #6 0x575855 in AP4_SampleEntry::Read(AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:115:9\r\n    #7 0x57d624 in AP4_VisualSampleEntry::AP4_VisualSampleEntry(unsigned int, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:742:5\r\n    #8 0x57d624 in AP4_AvcSampleEntry::AP4_AvcSampleEntry(unsigned int, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4SampleEntry.cpp:994\r\n    #9 0x5cbf58 in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:305:24\r\n    #10 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #11 0x586a2c in AP4_StsdAtom::AP4_StsdAtom(unsigned int, unsigned char, unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4StsdAtom.cpp:100:13\r\n    #12 0x58566f in AP4_StsdAtom::Create(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4StsdAtom.cpp:56:16\r\n    #13 0x5ca71c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:422:20\r\n    #14 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #15 0x60c29f in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #16 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #17 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #18 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #19 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #20 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #21 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #22 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #23 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #24 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #25 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #26 0x60b1d2 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #27 0x60b1d2 in AP4_ContainerAtom::Create(unsigned int, unsigned long long, bool, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:87\r\n    #28 0x5ca44c in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:751:20\r\n    #29 0x5c7fbd in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned long long&amp;, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:220:14\r\n    #30 0x60c561 in AP4_ContainerAtom::ReadChildren(AP4_AtomFactory&amp;, AP4_ByteStream&amp;, unsigned long long) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:193:12\r\n    #31 0x60c099 in AP4_ContainerAtom::AP4_ContainerAtom(unsigned int, unsigned long long, bool, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4ContainerAtom.cpp:138:5\r\n    #32 0x58e6ed in AP4_TrakAtom::AP4_TrakAtom(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4TrakAtom.cpp:165:5\r\n    #33 0x5c8e3b in AP4_TrakAtom::Create(unsigned int, AP4_ByteStream&amp;, AP4_AtomFactory&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4TrakAtom.h:58:20\r\n    #34 0x5c8e3b in AP4_AtomFactory::CreateAtomFromStream(AP4_ByteStream&amp;, unsigned int, unsigned int, unsigned long long, AP4_Atom*&amp;) \/tmp\/Bento4-1.5.0-617\/Source\/C++\/Core\/Ap4AtomFactory.cpp:377\r\n\r\nSUMMARY: AddressSanitizer: heap-buffer-overflow \/var\/tmp\/portage\/sys-libs\/compiler-rt-sanitizers-4.0.1\/work\/compiler-rt-4.0.1.src\/lib\/asan\/asan_interceptors.cc:453 in __asan_memcpy\r\nShadow bytes around the buggy address:\r\n  0x0c0c7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0c0c7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0c0c7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x0c0c7fff8000: fa fa fa fa 00 00 00 00 00 00 02 fa fa fa fa fa\r\n  0x0c0c7fff8010: 00 00 00 00 00 00 00 fa fa fa fa fa 00 00 00 00\r\n=&gt;0x0c0c7fff8020: 00 00 00 fa fa fa fa fa 00 00 00 00 00 00[04]fa\r\n  0x0c0c7fff8030: fa fa fa fa 00 00 00 00 00 00 04 fa fa fa fa fa\r\n  0x0c0c7fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c0c7fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c0c7fff8060: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c0c7fff8070: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\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  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 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==20986==ABORTING<\/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\/53499d8d4c69142137c7c7f0097a444783fdeb90\">https:\/\/github.com\/axiomatic-systems\/Bento4\/commit\/53499d8d4c69142137c7c7f0097a444783fdeb90<\/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-14646<\/p>\n<p><strong>Reproducer:<\/strong><br \/>\n<a href=\"https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00342-bento4-heapoverflow-AP4_DataBuffer_SetData\">https:\/\/github.com\/asarubbo\/poc\/blob\/master\/00342-bento4-heapoverflow-AP4_DataBuffer_SetData<\/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=\"NY6wrHB5PS\" class=\"wp-embedded-content\"><p><a href=\"http:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-heap-based-buffer-overflow-in-ap4_databuffersetdata-ap4databuffer-cpp\/\">bento4: heap-based buffer overflow in AP4_DataBuffer::SetData (Ap4DataBuffer.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-heap-based-buffer-overflow-in-ap4_databuffersetdata-ap4databuffer-cpp\/embed\/#?secret=NY6wrHB5PS\" data-secret=\"NY6wrHB5PS\" width=\"600\" height=\"338\" title=\"&#8220;bento4: heap-based buffer overflow in AP4_DataBuffer::SetData (Ap4DataBuffer.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 ==20986==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000000174 at pc 0x0000004ee515 &hellip; <a href=\"https:\/\/blogs.gentoo.org\/ago\/2017\/09\/14\/bento4-heap-based-buffer-overflow-in-ap4_databuffersetdata-ap4databuffer-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-zT","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2225"}],"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=2225"}],"version-history":[{"count":4,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2225\/revisions"}],"predecessor-version":[{"id":2295,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/posts\/2225\/revisions\/2295"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/media?parent=2225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/categories?post=2225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/ago\/wp-json\/wp\/v2\/tags?post=2225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}