{"action":"closed","issue":{"url":"https://api.github.com/repos/radare/radare2/issues/2832","labels_url":"https://api.github.com/repos/radare/radare2/issues/2832/labels{/name}","comments_url":"https://api.github.com/repos/radare/radare2/issues/2832/comments","events_url":"https://api.github.com/repos/radare/radare2/issues/2832/events","html_url":"https://github.com/radare/radare2/issues/2832","id":90488731,"number":2832,"title":"out of bounds heap read in r_mem_copyendian","user":{"login":"hannob","id":990588,"avatar_url":"https://avatars.githubusercontent.com/u/990588?v=3","gravatar_id":"","url":"https://api.github.com/users/hannob","html_url":"https://github.com/hannob","followers_url":"https://api.github.com/users/hannob/followers","following_url":"https://api.github.com/users/hannob/following{/other_user}","gists_url":"https://api.github.com/users/hannob/gists{/gist_id}","starred_url":"https://api.github.com/users/hannob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hannob/subscriptions","organizations_url":"https://api.github.com/users/hannob/orgs","repos_url":"https://api.github.com/users/hannob/repos","events_url":"https://api.github.com/users/hannob/events{/privacy}","received_events_url":"https://api.github.com/users/hannob/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/radare/radare2/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/radare/radare2/labels/fuzzing","name":"fuzzing","color":"009800"}],"state":"closed","locked":false,"assignee":{"login":"alvarofe","id":3474042,"avatar_url":"https://avatars.githubusercontent.com/u/3474042?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarofe","html_url":"https://github.com/alvarofe","followers_url":"https://api.github.com/users/alvarofe/followers","following_url":"https://api.github.com/users/alvarofe/following{/other_user}","gists_url":"https://api.github.com/users/alvarofe/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarofe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarofe/subscriptions","organizations_url":"https://api.github.com/users/alvarofe/orgs","repos_url":"https://api.github.com/users/alvarofe/repos","events_url":"https://api.github.com/users/alvarofe/events{/privacy}","received_events_url":"https://api.github.com/users/alvarofe/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-06-23T20:55:44Z","updated_at":"2015-06-28T18:16:10Z","closed_at":"2015-06-28T18:16:10Z","body":"This script will cause a heap oob:\r\nhttps://crashes.fuzzing-project.org/radare2-oob-heap-read-r_mem_copyendian\r\nContains the string \"pt@!\"\r\n\r\nIt must be tested with a real executable, however it seems any 64 bit elf will do.\r\nTest: radare2 -q -i [script] [elf_file]\r\n\r\nFound with american fuzzy lop. Address Sanitizer trace:\r\n```\r\n==9520==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000416d0 at pc 0x7f3558e41103 bp 0x7ffc7a950240 sp 0x7ffc7a950230\r\nREAD of size 4 at 0x6020000416d0 thread T0\r\n    #0 0x7f3558e41102 in memmove /usr/include/bits/string3.h:57\r\n    #1 0x7f3558e41102 in r_mem_copyendian /f/radare2/radare2/libr/util/mem.c:157\r\n    #2 0x7f3558ef84a7 in r_print_date_unix /f/radare2/radare2/libr/util/p_date.c:40\r\n    #3 0x7f355e12cda1 in cmd_print /f/radare2/radare2/libr/core/cmd_print.c:2891\r\n    #4 0x7f355e18dac6 in r_core_cmd_subst_i /f/radare2/radare2/libr/core/cmd.c:1569\r\n    #5 0x7f355e0ee8c4 in r_core_cmd_subst /f/radare2/radare2/libr/core/cmd.c:1081\r\n    #6 0x7f355e0efaa3 in r_core_cmd /f/radare2/radare2/libr/core/cmd.c:1938\r\n    #7 0x7f355e0f28f4 in r_core_cmd_lines /f/radare2/radare2/libr/core/cmd.c:1989\r\n    #8 0x7f355e0f2b64 in r_core_cmd_file /f/radare2/radare2/libr/core/cmd.c:2001\r\n    #9 0x7f355e0f5ba3 in r_core_run_script /f/radare2/radare2/libr/core/cmd.c:373\r\n    #10 0x405572 in main /f/radare2/radare2/binr/radare2/radare2.c:729\r\n    #11 0x7f3558656f9f in __libc_start_main (/lib64/libc.so.6+0x1ff9f)\r\n    #12 0x40a333 (/mnt/ram/radare2/radare2+0x40a333)\r\n\r\n0x6020000416d2 is located 0 bytes to the right of 2-byte region [0x6020000416d0,0x6020000416d2)\r\nallocated by thread T0 here:\r\n    #0 0x7f355e8209d6 in __interceptor_realloc (/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.2/libasan.so.1+0x579d6)\r\n    #1 0x7f355e0a1100 in r_core_block_size /f/radare2/radare2/libr/core/core.c:1108\r\n\r\nSUMMARY: AddressSanitizer: heap-buffer-overflow /usr/include/bits/string3.h:57 memmove\r\nShadow bytes around the buggy address:\r\n  0x0c0480000280: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c0480000290: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c04800002a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c04800002b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n  0x0c04800002c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa\r\n=>0x0c04800002d0: fa fa fa fa fa fa fa fa fa fa[02]fa fa fa 01 fa\r\n  0x0c04800002e0: fa fa 05 fa fa fa 05 fa fa fa 05 fa fa fa fd fa\r\n  0x0c04800002f0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fd\r\n  0x0c0480000300: fa fa fd fa fa fa fd fd fa fa 02 fa fa fa fd fd\r\n  0x0c0480000310: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\r\n  0x0c0480000320: fa fa fd fd fa fa fd fd fa fa fd fd fa fa fd fd\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  Heap right redzone:      fb\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 partial redzone:   f4\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  Contiguous container OOB:fc\r\n  ASan internal:           fe\r\n==9520==ABORTING\r\n"}}