[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug: heap-buffer-overflow in function fmt_entry
From: |
address@hidden |
Subject: |
Bug: heap-buffer-overflow in function fmt_entry |
Date: |
Fri, 11 Oct 2019 16:42:17 +0800 |
Version: snapshot label v6_1_20191005
POC: https://github.com/zjuchenyuan/fuzzpoc/raw/master/infotocap_poc3
```
Step 7/11 : RUN /tmp/infotocap fuzzpoc/infotocap_poc3 || exit 0
---> Running in c57813094f61
"fuzzpoc/infotocap_poc3", line 9, col 3, terminal '88:7': Missing separator
=================================================================
==6==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60300000efc4 at pc 0x000000439795 bp 0x7ffffffea610 sp 0x7ffffffea600
READ of size 1 at 0x60300000efc4 thread T0
#0 0x439794 in fmt_entry ../progs/dump_entry.c:1126
#1 0x43b00b in dump_entry ../progs/dump_entry.c:1540
#2 0x404eac in main ../progs/tic.c:1039
#3 0x7ffff6ac082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#4 0x408cd8 in _start (/tmp/infotocap+0x408cd8)
0x60300000efc4 is located 0 bytes to the right of 20-byte region [0x60300000efb0,0x60300000efc4)
allocated by thread T0 here:
#0 0x7ffff6f02602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4a6ad5 in _nc_tic_expand ../ncurses/./tinfo/comp_expand.c:85
SUMMARY: AddressSanitizer: heap-buffer-overflow ../progs/dump_entry.c:1126 fmt_entry
Shadow bytes around the buggy address:
0x0c067fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9de0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c067fff9df0: fa fa fa fa fa fa 00 00[04]fa fa fa 00 00 07 fa
0x0c067fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9e30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c067fff9e40: 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
==6==ABORTING
```
Reproducible Docker image has been pushed to `zjuchenyuan/dockerized_poc:ncurses`, Dockerfile:
```
FROM zjuchenyuan/afl
ENV AFL_USE_ASAN=1 ASAN_OPTIONS="detect_leaks=0"
RUN git clone https://github.com/ThomasDickey/ncurses-snapshots &&\
cd ncurses-snapshots &&\
git checkout 8805e9e &&\
./configure --disable-shared &&\
make -j &&\
cp ./progs/tic /tmp/infotocap
RUN git clone https://github.com/zjuchenyuan/fuzzpoc
RUN /tmp/infotocap fuzzpoc/infotocap_poc3 || exit 0
```
- Bug: heap-buffer-overflow in function fmt_entry,
address@hidden <=