[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug: heap-buffer-overflow in function postprocess_terminfo
From: |
address@hidden |
Subject: |
Bug: heap-buffer-overflow in function postprocess_terminfo |
Date: |
Fri, 11 Oct 2019 16:44:32 +0800 |
Version: snapshot label v6_1_20191005
POC: https://github.com/zjuchenyuan/fuzzpoc/raw/master/infotocap_poc5
```
# /tmp/infotocap fuzzpoc/infotocap_poc5
=================================================================
==7==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x62100001b500 at pc 0x0000004b9e95 bp 0x7fffffffafd0 sp 0x7fffffffafc0
READ of size 1 at 0x62100001b500 thread T0
#0 0x4b9e94 in postprocess_terminfo ../ncurses/./tinfo/parse_entry.c:1043
#1 0x4c31e0 in _nc_parse_entry ../ncurses/./tinfo/parse_entry.c:599
#2 0x4ae6fc in _nc_read_entry_source ../ncurses/./tinfo/comp_parse.c:225
#3 0x4044b8 in main ../progs/tic.c:961
#4 0x7ffff6ac082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#5 0x408cd8 in _start (/tmp/infotocap+0x408cd8)
0x62100001b500 is located 0 bytes to the right of 4096-byte region [0x62100001a500,0x62100001b500)
allocated by thread T0 here:
#0 0x7ffff6f02602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4fa2d9 in _nc_init_entry ../ncurses/./tinfo/alloc_entry.c:74
SUMMARY: AddressSanitizer: heap-buffer-overflow ../ncurses/./tinfo/parse_entry.c:1043 postprocess_terminfo
Shadow bytes around the buggy address:
0x0c427fffb650: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c427fffb660: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c427fffb670: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c427fffb680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c427fffb690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c427fffb6a0:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c427fffb6b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c427fffb6c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c427fffb6d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c427fffb6e0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c427fffb6f0: 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
==7==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_poc5 || exit 0
```
- Bug: heap-buffer-overflow in function postprocess_terminfo,
address@hidden <=