swftools icon indicating copy to clipboard operation
swftools copied to clipboard

heap-buffer-overflow exists in the function swf_GetD64 in rfxswf.c

Open cxlzff opened this issue 3 years ago • 0 comments

system info

Ubuntu x86_64, clang 6.0, swfdump (latest master a9d5082)

Command line

./src/swfdump -D @@

AddressSanitizer output

==8687==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60b00000aff8 at pc 0x000000473b4e bp 0x7fffffffdc10 sp 0x7fffffffdc00 READ of size 8 at 0x60b00000aff8 thread T0 #0 0x473b4d in swf_GetD64 /test/swftools-asan/lib/rfxswf.c:520 #1 0x4a7851 in pool_read as3/pool.c:1119 #2 0x4935ec in swf_ReadABC as3/abc.c:748 #3 0x409045 in main /test/swftools-asan/src/swfdump.c:1577 #4 0x7ffff68a683f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f) #5 0x40c168 in _start (/test/swftools-asan/src/swfdump+0x40c168)

0x60b00000affd is located 0 bytes to the right of 109-byte region [0x60b00000af90,0x60b00000affd) allocated by thread T0 here: #0 0x7ffff6f02602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602) #1 0x532fa7 in rfx_alloc /test/swftools-asan/lib/mem.c:30 #2 0x541396 (/test/swftools-asan/src/swfdump+0x541396)

SUMMARY: AddressSanitizer: heap-buffer-overflow /test/swftools-asan/lib/rfxswf.c:520 swf_GetD64 Shadow bytes around the buggy address: 0x0c167fff95a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff95b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff95c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff95d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff95e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa =>0x0c167fff95f0: fa fa 00 00 00 00 00 00 00 00 00 00 00 00 00[05] 0x0c167fff9600: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff9610: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff9620: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff9630: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 0x0c167fff9640: 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 Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 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 ==8687==ABORTING

POC swf_GetD64_poc

cxlzff avatar Oct 07 '21 13:10 cxlzff