[2019-08-06] - Found with American Fuzzy Lop - CVE-2019-14732 Multiple heap-based buffer overflows in Ca2mLoader::load(), in src/a2m.cpp. ``` ================================================================= ==6688==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x63000000fc28 at pc 0x7f43e5614913 bp 0x7ffe7780f470 sp 0x7ffe7780f468 WRITE of size 1 at 0x63000000fc28 thread T0 #0 0x7f43e5614912 in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) /home/fcambus/adplug/src/a2m.cpp:106:37 #1 0x7f43e56341d5 in CAdPlug::factory(std::__cxx11::basic_string, std::allocator > const&, Copl*, CPlayers const&, CFileProvider const&) /home/fcambus/adplug/src/adplug.cpp:169:10 #2 0x4fcd62 in play(char const*, Player*, int) /home/fcambus/adplay-unix/src/adplay.cc:309:11 #3 0x4fbaf4 in main /home/fcambus/adplay-unix/src/adplay.cc:544:5 #4 0x7f43e4e7209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) #5 0x41f759 in _start (/home/fcambus/reps2/adplay+0x41f759) 0x63000000fc28 is located 0 bytes to the right of 63528-byte region [0x630000000400,0x63000000fc28) allocated by thread T0 here: #0 0x4f6972 in operator new[](unsigned long) (/home/fcambus/reps2/adplay+0x4f6972) #1 0x7f43e5614614 in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) /home/fcambus/adplug/src/a2m.cpp:99:13 #2 0x7f43e56341d5 in CAdPlug::factory(std::__cxx11::basic_string, std::allocator > const&, Copl*, CPlayers const&, CFileProvider const&) /home/fcambus/adplug/src/adplug.cpp:169:10 #3 0x4fcd62 in play(char const*, Player*, int) /home/fcambus/adplay-unix/src/adplay.cc:309:11 #4 0x4fbaf4 in main /home/fcambus/adplay-unix/src/adplay.cc:544:5 #5 0x7f43e4e7209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fcambus/adplug/src/a2m.cpp:106:37 in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) Shadow bytes around the buggy address: 0x0c607fff9f30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c607fff9f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c607fff9f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c607fff9f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c607fff9f70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c607fff9f80: 00 00 00 00 00[fa]fa fa fa fa fa fa fa fa fa fa 0x0c607fff9f90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c607fff9fa0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c607fff9fb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c607fff9fc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c607fff9fd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==6688==ABORTING ``` ``` ================================================================= ==6686==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61a000000508 at pc 0x7efe60571e7c bp 0x7ffe914318d0 sp 0x7ffe914318c8 WRITE of size 1 at 0x61a000000508 thread T0 #0 0x7efe60571e7b in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) /home/fcambus/adplug/src/a2m.cpp:184:35 #1 0x7efe6058f1d5 in CAdPlug::factory(std::__cxx11::basic_string, std::allocator > const&, Copl*, CPlayers const&, CFileProvider const&) /home/fcambus/adplug/src/adplug.cpp:169:10 #2 0x4fcd62 in play(char const*, Player*, int) /home/fcambus/adplay-unix/src/adplay.cc:309:11 #3 0x4fbaf4 in main /home/fcambus/adplay-unix/src/adplay.cc:544:5 #4 0x7efe5fdcd09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) #5 0x41f759 in _start (/home/fcambus/reps2/adplay+0x41f759) 0x61a000000508 is located 0 bytes to the right of 1160-byte region [0x61a000000080,0x61a000000508) allocated by thread T0 here: #0 0x4f6972 in operator new[](unsigned long) (/home/fcambus/reps2/adplay+0x4f6972) #1 0x7efe60570f6f in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) /home/fcambus/adplug/src/a2m.cpp:152:13 #2 0x7efe6058f1d5 in CAdPlug::factory(std::__cxx11::basic_string, std::allocator > const&, Copl*, CPlayers const&, CFileProvider const&) /home/fcambus/adplug/src/adplug.cpp:169:10 #3 0x4fcd62 in play(char const*, Player*, int) /home/fcambus/adplay-unix/src/adplay.cc:309:11 #4 0x4fbaf4 in main /home/fcambus/adplay-unix/src/adplay.cc:544:5 #5 0x7efe5fdcd09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a) SUMMARY: AddressSanitizer: heap-buffer-overflow /home/fcambus/adplug/src/a2m.cpp:184:35 in Ca2mLoader::load(std::__cxx11::basic_string, std::allocator > const&, CFileProvider const&) Shadow bytes around the buggy address: 0x0c347fff8050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c347fff8060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c347fff8070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c347fff8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x0c347fff8090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 =>0x0c347fff80a0: 00[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c347fff80b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c347fff80c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c347fff80d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c347fff80e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c347fff80f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe Left alloca redzone: ca Right alloca redzone: cb Shadow gap: cc ==6686==ABORTING ```