Bug 974839 (CVE-2016-3634) - VUL-1: CVE-2016-3634: tiff: Illegal read in tagCompare in tif_dirinfo.c when using thumbnail command
Summary: VUL-1: CVE-2016-3634: tiff: Illegal read in tagCompare in tif_dirinfo.c when ...
Status: RESOLVED WONTFIX
Alias: CVE-2016-3634
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P4 - Low : Minor
Target Milestone: ---
Assignee: Fridrich Strba
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/166959/
Whiteboard: CVSSv2:RedHat:CVE-2016-3634:4.3:(AV:N...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-11 08:35 UTC by Johannes Segitz
Modified: 2019-04-25 14:48 UTC (History)
3 users (show)

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


Attachments
tagCompare_cve_20163634.tif (384 bytes, image/tiff)
2016-11-25 08:24 UTC, Alexander Bergmann
Details

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

Product: libtiff
Affected Versions: <= 4.0.6
Vulnerability Type: Illegel read
Vendor URL: http://www.remotesensing.org/libtiff/
CVE ID: CVE-2016-3634
Credit: Kaixiang Zhang of the Cloud Security Team, Qihoo 360

Introduction
Illegal read occurs in the tagCompare function in tif_dirinfo.c when using thumbnail command, which allows attackers to exploit this issue to cause denial-of-service.

/libtiff/tif_dirinfo.c: 341
tagCompare(const void* a, const void* b)
337{
338          const TIFFField* ta = *(const TIFFField**) a;
339          const TIFFField* tb = *(const TIFFField**) b;
340          /* NB: be careful of return values for 16-bit platforms */
341          if (ta->field_tag != tb->field_tag)
342                         return (int)ta->field_tag - (int)tb->field_tag;
343          else
344                         return (ta->field_type == TIFF_ANY) ?
345                                         0 : ((int)tb->field_type - (int)ta->field_type);
346}

gdb  --args  thumbnail  tagCompare.tif  tmpout.tif
����.
Program received signal SIGSEGV, Segmentation fault.
tagCompare (b=0x8164a84, a=<synthetic pointer>) at tif_dirinfo.c:341
341        if (ta->field_tag != tb->field_tag)
(gdb) bt
#0  tagCompare (b=0x8164a84, a=<synthetic pointer>) at tif_dirinfo.c:341
#1  bsearch (__compar=0x8067330 <tagCompare>, __size=4, __nmemb=153, __base=0x8164a60, __key=<synthetic pointer>) at /usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:33
#2  TIFFFindField (tif=0x8164530, tag=262, dt=TIFF_NOTYPE) at tif_dirinfo.c:518
#3  0x08060e06 in TIFFVGetField (ap=0xbffff238 "\032\065\026\b\377\377\377\377_\314\376\267\350\372\", tag=262, tif=0x8164530) at tif_dir.c:1172
#4  TIFFGetField (tif=0x8164530, tag=262) at tif_dir.c:1158
#5  0x0804ae2f in generateThumbnail (out=<optimized out>, in=<optimized out>) at thumbnail.c:631
#6  main (argc=3, argv=0xbffff374) at thumbnail.c:122
(gdb) p tb
$5 = (const TIFFField *) 0xffffffff

References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-3634
http://people.canonical.com/~ubuntu-security/cve/2016/CVE-2016-3634.html
http://www.openwall.com/lists/oss-security/2016/04/08/13
Comment 1 Swamp Workflow Management 2016-04-11 22:00:21 UTC
bugbot adjusting priority
Comment 4 Alexander Bergmann 2016-11-23 16:31:11 UTC
http://bugzilla.maptools.org/show_bug.cgi?id=2547#c1

The thumbnail utility is no longer installed by the libtiff package (as will
appear in 4.0.7).  It now only exists for internal testing.
Comment 8 Alexander Bergmann 2016-11-25 08:24:44 UTC
Created attachment 703719 [details]
tagCompare_cve_20163634.tif

I've got the original reproducer from the reporter.
Comment 9 Alexander Bergmann 2017-12-13 14:25:46 UTC
The reproducer did not work with the latest SLE tiff versions.

Furthermore the thumbnail tool is not part of the tiff package anymore and will not be present in future SLE major versions.

Closing as WONTFIX.