Headline
CVE-2017-9929: stack buffer overflow in get_fileinfo (lrzip.c:1074) · Issue #75 · ckolivas/lrzip
In lrzip 0.631, a stack buffer overflow was found in the function get_fileinfo in lrzip.c:1074, which allows attackers to cause a denial of service via a crafted file.
#lrzip -i $FILE
stack-buffer-overflow on address 0x7fff0e9e9038 at pc 0x7f8ece5fb795 bp 0x7fff0e9e8da0 sp 0x7fff0e9e8550
WRITE of size 10 at 0x7fff0e9e9038 thread T0
#0 0x7f8ece5fb794 in __interceptor_read ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:545
#1 0x413f27 in get_fileinfo /home/haojun/Downloads/lrzip-master/lrzip.c:1074
#2 0x409ee1 in main /home/haojun/Downloads/lrzip-master/main.c:671
#3 0x7f8ecd337b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)
#4 0x403648 (/home/haojun/Downloads/lrzip-build/bin/lrzip+0x403648)
Address 0x7fff0e9e9038 is located in stack of thread T0 at offset 424 in frame
#0 0x412454 in get_fileinfo /home/haojun/Downloads/lrzip-master/lrzip.c:926
This frame has 10 object(s):
[32, 33) 'chunk_byte'
[96, 97) 'ctype'
[160, 168) 'u_len'
[224, 232) 'c_len'
[288, 296) 'last_head'
[352, 360) 'expected_size'
[416, 424) 'chunk_size' <== Memory access at offset 424 overflows this variable
[480, 496) 'stream_head'
[544, 560) 'md5_stored'
[608, 752) 'fdin_stat'
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
(longjmp and C++ exceptions *are* supported)
SUMMARY: stack-buffer-overflow ../../../../libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:545 in __interceptor_read
Shadow bytes around the buggy address:
0x100061d351b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100061d351c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100061d351d0: 00 00 f1 f1 f1 f1 01 f4 f4 f4 f2 f2 f2 f2 01 f4
0x100061d351e0: f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 00 f4
0x100061d351f0: f4 f4 f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 00 f4
=>0x100061d35200: f4 f4 f2 f2 f2 f2 00[f4]f4 f4 f2 f2 f2 f2 00 00
0x100061d35210: f4 f4 f2 f2 f2 f2 00 00 f4 f4 f2 f2 f2 f2 00 00
0x100061d35220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x100061d35230: f4 f4 f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00
0x100061d35240: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f4
0x100061d35250: f4 f4 f2 f2 f2 f2 04 f4 f4 f4 f2 f2 f2 f2 00 f4
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
Left alloca redzone: ca
Right alloca redzone: cb