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 overflow (write) in r_print_randomart #2869

Closed
hannob opened this issue Jul 1, 2015 · 1 comment
Closed

heap overflow (write) in r_print_randomart #2869

hannob opened this issue Jul 1, 2015 · 1 comment

Comments

@hannob
Copy link

hannob commented Jul 1, 2015

Input script:
https://crashes.fuzzing-project.org/radare2-script-heap-overflow-write-r_print_randomart
Contains the command "pk@4000000000000".

Address Sanitizer:

=================================================================
==26187==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61100000525c at pc 0x7f087e25fdff bp 0x7ffc4de25970 sp 0x7ffc4de25960
WRITE of size 1 at 0x61100000525c thread T0
    #0 0x7f087e25fdfe in r_print_randomart /f/radare2/radare2/libr/util/randomart.c:113
    #1 0x7f0883456d0c in cmd_print /f/radare2/radare2/libr/core/cmd_print.c:2850
    #2 0x7f08834c5eee in r_core_cmd_subst_i /f/radare2/radare2/libr/core/cmd.c:1578
    #3 0x7f08834259ac in r_core_cmd_subst /f/radare2/radare2/libr/core/cmd.c:1084
    #4 0x7f0883426b53 in r_core_cmd /f/radare2/radare2/libr/core/cmd.c:1947
    #5 0x7f0883429a7c in r_core_cmd_lines /f/radare2/radare2/libr/core/cmd.c:1998
    #6 0x7f0883429cb4 in r_core_cmd_file /f/radare2/radare2/libr/core/cmd.c:2010
    #7 0x7f088342c9ee in r_core_run_script /f/radare2/radare2/libr/core/cmd.c:373
    #8 0x405236 in main /f/radare2/radare2/binr/radare2/radare2.c:729
    #9 0x7f087d983f9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f)
    #10 0x409e6d (/mnt/ram/r2/radare2+0x409e6d)

0x61100000525c is located 0 bytes to the right of 220-byte region [0x611000005180,0x61100000525c)
allocated by thread T0 here:
    #0 0x7f0883b586f7 in malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libasan.so.1+0x576f7)
    #1 0x7f087e25e12a in r_print_randomart /f/radare2/radare2/libr/util/randomart.c:50

SUMMARY: AddressSanitizer: heap-buffer-overflow /f/radare2/radare2/libr/util/randomart.c:113 r_print_randomart
Shadow bytes around the buggy address:
  0x0c227fff89f0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8a00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8a10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8a20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8a30: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c227fff8a40: 00 00 00 00 00 00 00 00 00 00 00[04]fa fa fa fa
  0x0c227fff8a50: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x0c227fff8a60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c227fff8a70: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x0c227fff8a80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c227fff8a90: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
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
  Contiguous container OOB:fc
  ASan internal:           fe
==26187==ABORTING
@alvarofe alvarofe self-assigned this Jul 1, 2015
alvarofe added a commit to alvarofe/radare2 that referenced this issue Jul 5, 2015
@neuschaefer
Copy link
Contributor

@hannob The randomart code seems to be originally from OpenSSH, which may be worth checking, too.

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

3 participants