Bug 974447 - (CVE-2016-3620) VUL-1: CVE-2016-3620: tiff: Out-of-bounds Read in the bmp2tiff tool (zip packing)
(CVE-2016-3620)
VUL-1: CVE-2016-3620: tiff: Out-of-bounds Read in the bmp2tiff tool (zip pack...
Status: RESOLVED FIXED
Classification: Novell Products
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents
unspecified
Other Other
: P4 - Low : Minor
: ---
Assigned To: Security Team bot
Security Team bot
https://smash.suse.de/issue/166617/
CVSSv2:SUSE:CVE-2016-3620:5.0:(AV:N...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-04-07 09:10 UTC by Johannes Segitz
Modified: 2019-01-14 08:10 UTC (History)
4 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
crash1.tif (156 bytes, application/octet-stream)
2016-10-11 11:56 UTC, Marcus Meissner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Segitz 2016-04-07 09:10:11 UTC
Details
=======

Product: libtiff
Affected Versions: <= 4.0.6
Vulnerability Type: Out-of-bounds Read
Vendor URL: http://www.libtiff.org/
CVE ID: CVE-2016-3620
Credit: Mei Wang of the Cloud Security Team, Qihoo 360

Introduction
============

 ZIPEncode function in tif_zip.c in bmp2tiff allows attackers to cause a denial of service (Out-of-bounds Read) via a crafted bmp image with param -c zip.


./bmp2tiff  -c zip  ./sample/bmp2tiff_zip.bmp 1.tif

=================================================================
==14228== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f563bf05800 at pc 0x7f5638d8eb3f bp 0x7fffca413bb0 sp 0x7fffca413358
READ of size 32768 at 0x7f563bf05800 thread T0
    #0 0x7f5638d8eb3e (/lib64/libasan.so.0+0xeb3e)
    #1 0x7f5638b6a136 in fill_window (/lib64/libz.so.1+0x3136)
    #2 0x7f5638b6abbf in deflate_slow (/lib64/libz.so.1+0x3bbf)
    #3 0x7f5638b6bc6f in deflate (/lib64/libz.so.1+0x4c6f)
    #4 0x49cfed in ZIPEncode /home/dazhuang/asan/libtiff-master/libtiff/tif_zip.c:277
    #5 0x45665e in TIFFWriteScanline /home/dazhuang/asan/libtiff-master/libtiff/tif_write.c:173
    #6 0x40450f in main /home/dazhuang/asan/libtiff-master/tools/bmp2tiff.c:775
    #7 0x7f56384c5af4 in __libc_start_main (/lib64/libc.so.6+0x21af4)
    #8 0x4019a8 in _start (/home/dazhuang/asan/libtiff-master/tools/bmp2tiff+0x4019a8)
0x7f563bf05800 is located 0 bytes to the right of 1114112-byte region [0x7f563bdf5800,0x7f563bf05800)
allocated by thread T0 here:
    #0 0x7f5638d96129 (/lib64/libasan.so.0+0x16129)
    #1 0x45b761 in _TIFFmalloc /home/dazhuang/asan/libtiff-master/libtiff/tif_unix.c:316
    #2 0x4037c3 in main /home/dazhuang/asan/libtiff-master/tools/bmp2tiff.c:678
    #3 0x7f56384c5af4 in __libc_start_main (/lib64/libc.so.6+0x21af4)
SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 ??
Shadow bytes around the buggy address:
  0x0feb477d8ab0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb477d8ac0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb477d8ad0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb477d8ae0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0feb477d8af0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0feb477d8b00:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0feb477d8b10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0feb477d8b20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0feb477d8b30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0feb477d8b40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0feb477d8b50: 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 righ 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
  ASan internal:         fe
==14228== ABORTING


References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-3620
http://seclists.org/oss-sec/2016/q2/21
Comment 1 Swamp Workflow Management 2016-04-07 22:01:02 UTC
bugbot adjusting priority
Comment 3 Marcus Meissner 2016-10-11 11:56:06 UTC
Created attachment 696774 [details]
crash1.tif

QA REPRODUCER:

bmp2tiff -c zip crash1.tif foo.tiff
Comment 4 Alexander Bergmann 2016-11-23 17:16:16 UTC
http://bugzilla.maptools.org/show_bug.cgi?id=2570#c1

Closing as wontfix since bmp2tiff has been removed from libtiff
Comment 6 Petr Gajdos 2018-11-13 14:29:29 UTC
The same resolution as in bug 974446 comment 4:

(gdb) p length
$1 = 1
(gdb) p j
$2 = 476
(gdb) p width
$3 = 1114112
(gdb)

This is fixed by tiff-bmp2tiff.c-update.patch.
Comment 7 Petr Gajdos 2018-11-13 14:29:41 UTC
Will amend rpm changelog for: 11,10sp3/tiff.
Comment 8 Petr Gajdos 2018-11-14 14:21:28 UTC
I believe all fixed.
Comment 11 Swamp Workflow Management 2018-11-23 20:13:02 UTC
SUSE-SU-2018:3879-1: An update that fixes 11 vulnerabilities is now available.

Category: security (moderate)
Bug References: 1010163,1014461,1040080,1040322,1074186,1099257,1113672,974446,974447,974448,983440
CVE References: CVE-2015-8870,CVE-2016-3619,CVE-2016-3620,CVE-2016-3621,CVE-2016-5319,CVE-2016-9273,CVE-2017-17942,CVE-2017-9117,CVE-2017-9147,CVE-2018-12900,CVE-2018-18661
Sources used:
SUSE Linux Enterprise Software Development Kit 11-SP4 (src):    tiff-3.8.2-141.169.22.1
SUSE Linux Enterprise Server 11-SP4 (src):    tiff-3.8.2-141.169.22.1
SUSE Linux Enterprise Debuginfo 11-SP4 (src):    tiff-3.8.2-141.169.22.1
Comment 12 Swamp Workflow Management 2018-12-11 10:05:35 UTC
An update workflow for this issue was started.
This issue was rated as moderate.
Please submit fixed packages until 2018-12-25.
When done, reassign the bug to security-team@suse.de.
https://swamp.suse.de/webswamp/wf/64180
Comment 13 Marcus Meissner 2019-01-14 08:10:54 UTC
released