Bugzilla – Bug 974544
VUL-1: CVE-2016-3631: tiff: Illegal read in the cpStrips and cpTiles function
Last modified: 2020-07-25 21:50:51 UTC
Details ======= Product: libtiff Affected Versions: <= 4.0.6 Vulnerability Type: Illegel read Vendor URL: http://www.libtiff.org/ CVE ID: CVE-2016-3631 Credit: Kaixiang Zhang of the Cloud Security Team, Qihoo 360 Introduction Illegal read occurs in the cpStrips and cpTiles function in thumbnail.c in thumbnail allows attackers to exploit this issue to cause denial-of-service. libtiff/tools/thumbnail.c:314. 313 for (s = 0; s < ns; s++) { 314 if (bytecounts[s] > (uint64) bufsize) { 315 buf = (unsigned char *)_TIFFrealloc(buf, (tmsize_t)bytecounts[s]); 316 if (!buf) 317 goto bad; 318 bufsize = (tmsize_t)bytecounts[s]; 319 } 320 if (TIFFReadRawStrip(in, s, buf, (tmsize_t)bytecounts[s]) < 0 || 321 TIFFWriteRawStrip(out, s, buf, (tmsize_t)bytecounts[s]) < 0) { 322 _TIFFfree(buf); 323 return 0; 324 } 325 } gdb --args thumbnail cpStrips.tif tmpout.tif …… Program received signal SIGSEGV, Segmentation fault. 0x0804c7bf in cpStrips (out=<optimized out>, in=0x8164530) at thumbnail.c:314 314 if (bytecounts[s] > (uint64) bufsize) { (gdb) bt #0 0x0804c7bf in cpStrips (out=<optimized out>, in=0x8164530) at thumbnail.c:314 #1 cpIFD (out=<optimized out>, in=<optimized out>) at thumbnail.c:378 #2 main (argc=3, argv=0xbffff384) at thumbnail.c:124 (gdb) p *bytecounts Cannot access memory at address 0x42900001 References: http://seclists.org/oss-sec/2016/q2/24 https://bugzilla.redhat.com/show_bug.cgi?id=1316872 http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2016-3631
bugbot adjusting priority
Created attachment 696429 [details] tiffcp-crash1.tiff Found by afl locally, might not match this case. out of bounds overwrite QA REPRODUCER: tiffcp tiffcp-crash1.tiff good.tiff output.tiff
Created attachment 696430 [details] good.tiff QA REPRODUCER: good.tiff for above line (a working tiff)
Created attachment 703716 [details] cpStrips_cve_20163631.tif I've got the original reproducer from the reporter.
The thumbnail binary will not be available in SLE-15 which has tiff-4.0.8. Closing this minor issue as WONTFIX as upstream simply removed the thumbnail tool from the project.