Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

heap-buffer-overflow in dcputs at decompile.c:105 #192

Open
SuhwanSong opened this issue Feb 24, 2020 · 0 comments
Open

heap-buffer-overflow in dcputs at decompile.c:105 #192

SuhwanSong opened this issue Feb 24, 2020 · 0 comments

Comments

@SuhwanSong
Copy link

I found a heap-buffer-overflow in dcputs at decompile.c:105
How to reproduce:
$ swftocxx $PoC

Version : 0.4.8
commit 5009802

PoC
Asan log

==22645==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f248929b800 at pc 0x561e4b61e4af bp 0x7fff900b5630 sp 0x7fff900b5620
WRITE of size 1 at 0x7f248929b800 thread T0
    #0 0x561e4b61e4ae in dcputchar /home/suhwan/project/program/libming/util/decompile.c:116
    #1 0x561e4b62c32e in decompileCALLMETHOD /home/suhwan/project/program/libming/util/decompile.c:2921
    #2 0x561e4b62d9f3 in decompileAction /home/suhwan/project/program/libming/util/decompile.c:3360
    #3 0x561e4b62dda9 in decompileActions /home/suhwan/project/program/libming/util/decompile.c:3494
    #4 0x561e4b62b8a1 in decompileDEFINEFUNCTION /home/suhwan/project/program/libming/util/decompile.c:2834
    #5 0x561e4b62d9c1 in decompileAction /home/suhwan/project/program/libming/util/decompile.c:3354
    #6 0x561e4b62dda9 in decompileActions /home/suhwan/project/program/libming/util/decompile.c:3494
    #7 0x561e4b62dedf in decompile5Action /home/suhwan/project/program/libming/util/decompile.c:3517
    #8 0x561e4b61a0f3 in outputSWF_DOACTION /home/suhwan/project/program/libming/util/outputscript.c:1551
    #9 0x561e4b61c703 in outputBlock /home/suhwan/project/program/libming/util/outputscript.c:2083
    #10 0x561e4b61d7d0 in readMovie /home/suhwan/project/program/libming/util/main.c:281
    #11 0x561e4b61df64 in main /home/suhwan/project/program/libming/util/main.c:354
    #12 0x7f2493996b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #13 0x561e4b60fff9 in _start (/home/suhwan/project/fuzz-input-validate/test/asan/swftocxx+0x13ff9)

0x7f248929b800 is located 0 bytes to the right of 204800-byte region [0x7f2489269800,0x7f248929b800)
allocated by thread T0 here:
    #0 0x7f2494715f40 in realloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdef40)
    #1 0x561e4b61e362 in dcchkstr /home/suhwan/project/program/libming/util/decompile.c:93
    #2 0x561e4b61e3d0 in dcputs /home/suhwan/project/program/libming/util/decompile.c:104
    #3 0x561e4b61e62f in dcprintf /home/suhwan/project/program/libming/util/decompile.c:130
    #4 0x561e4b6220b1 in decompilePUSHPARAM /home/suhwan/project/program/libming/util/decompile.c:886
    #5 0x561e4b624ab4 in decompileINCR_DECR /home/suhwan/project/program/libming/util/decompile.c:1620
    #6 0x561e4b62d87c in decompileAction /home/suhwan/project/program/libming/util/decompile.c:3315
    #7 0x561e4b62dda9 in decompileActions /home/suhwan/project/program/libming/util/decompile.c:3494
    #8 0x561e4b62b8a1 in decompileDEFINEFUNCTION /home/suhwan/project/program/libming/util/decompile.c:2834
    #9 0x561e4b62d9c1 in decompileAction /home/suhwan/project/program/libming/util/decompile.c:3354
    #10 0x561e4b62dda9 in decompileActions /home/suhwan/project/program/libming/util/decompile.c:3494
    #11 0x561e4b62dedf in decompile5Action /home/suhwan/project/program/libming/util/decompile.c:3517
    #12 0x561e4b61a0f3 in outputSWF_DOACTION /home/suhwan/project/program/libming/util/outputscript.c:1551
    #13 0x561e4b61c703 in outputBlock /home/suhwan/project/program/libming/util/outputscript.c:2083
    #14 0x561e4b61d7d0 in readMovie /home/suhwan/project/program/libming/util/main.c:281
    #15 0x561e4b61df64 in main /home/suhwan/project/program/libming/util/main.c:354
    #16 0x7f2493996b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/suhwan/project/program/libming/util/decompile.c:116 in dcputchar
Shadow bytes around the buggy address:
  0x0fe51124b6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe51124b6c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe51124b6d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe51124b6e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe51124b6f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe51124b700:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe51124b710: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe51124b720: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe51124b730: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe51124b740: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe51124b750: 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
==22645==ABORTING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant