[Secure-testing-team] Bug#863153: lrzip: CVE-2017-8844: heap-based buffer overflow write in read_1g

Salvatore Bonaccorso carnil at debian.org
Mon May 22 18:40:48 UTC 2017


Source: lrzip
Version: 0.631-1
Severity: important
Tags: security upstream
Forwarded: https://github.com/ckolivas/lrzip/issues/70

Hi,

the following vulnerability was published for lrzip.

CVE-2017-8844[0]:
| The read_1g function in stream.c in liblrzip.so in lrzip 0.631 allows
| remote attackers to cause a denial of service (heap-based buffer
| overflow and application crash) or possibly have unspecified other
| impact via a crafted archive.

./lrzip -t /root/poc/00232-lrzip-heapoverflow-read_1g 
Decompressing...
=================================================================
==13952==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000ef13 at pc 0x7fe0d6a35965 bp 0x7fff12b23c70 sp 0x7fff12b23420
WRITE of size 8 at 0x60200000ef13 thread T0
    #0 0x7fe0d6a35964 in read (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x48964)
    #1 0x42aa75 in read_1g stream.c:731
    #2 0x42ac71 in read_buf stream.c:774
    #3 0x432110 in fill_buffer stream.c:1648
    #4 0x4333d5 in read_stream stream.c:1755
    #5 0x422073 in read_vchars runzip.c:79
    #6 0x42304e in unzip_match runzip.c:208
    #7 0x423d4b in runzip_chunk runzip.c:329
    #8 0x4244a8 in runzip_fd runzip.c:382
    #9 0x411378 in decompress_file lrzip.c:826
    #10 0x409b39 in main main.c:669
    #11 0x7fe0d55692b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
    #12 0x4032e9 in _start (/root/lrzip-0.631/lrzip+0x4032e9)

0x60200000ef13 is located 0 bytes to the right of 3-byte region [0x60200000ef10,0x60200000ef13)
allocated by thread T0 here:
    #0 0x7fe0d6aaed28 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1d28)
    #1 0x431ff2 in fill_buffer stream.c:1643
    #2 0x4333d5 in read_stream stream.c:1755
    #3 0x422073 in read_vchars runzip.c:79
    #4 0x42304e in unzip_match runzip.c:208
    #5 0x423d4b in runzip_chunk runzip.c:329
    #6 0x4244a8 in runzip_fd runzip.c:382
    #7 0x411378 in decompress_file lrzip.c:826
    #8 0x409b39 in main main.c:669
    #9 0x7fe0d55692b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)

SUMMARY: AddressSanitizer: heap-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x48964) in read
Shadow bytes around the buggy address:
  0x0c047fff9d90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9da0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9db0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9dd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c047fff9de0: fa fa[03]fa fa fa fd fd fa fa fd fa fa fa fd fd
  0x0c047fff9df0: fa fa 00 00 fa fa 04 fa fa fa 03 fa fa fa 05 fa
  0x0c047fff9e00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff9e30: 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
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==13952==ABORTING

If you fix the vulnerability please also make sure to include the
CVE (Common Vulnerabilities & Exposures) id in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2017-8844
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8844
[1] https://github.com/ckolivas/lrzip/issues/70

Please adjust the affected versions in the BTS as needed.

Regards,
Salvatore



More information about the Secure-testing-team mailing list