v4.0.7.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. Changes in TIFF v4.0.7
  6. </TITLE>
  7. </HEAD>
  8. <BODY BGCOLOR=white>
  9. <FONT FACE="Helvetica, Arial, Sans">
  10. <BASEFONT SIZE=4>
  11. <B><FONT SIZE=+3>T</FONT>IFF <FONT SIZE=+2>C</FONT>HANGE <FONT SIZE=+2>I</FONT>NFORMATION</B>
  12. <BASEFONT SIZE=3>
  13. <UL>
  14. <HR SIZE=4 WIDTH=65% ALIGN=left>
  15. <B>Current Version</B>: v4.0.7<BR>
  16. <B>Previous Version</B>: <A HREF=v4.0.6.html>v4.0.6</a><BR>
  17. <B>Master Download Site</B>: <A HREF="https://download.osgeo.org/libtiff">
  18. download.osgeo.org</a>, directory pub/libtiff</A><BR>
  19. <B>Master HTTP Site #1</B>: <A HREF="http://www.simplesystems.org/libtiff/">
  20. http://www.simplesystems.org/libtiff/</a><BR>
  21. <B>Master HTTP Site #2</B>: <A HREF="http://libtiff.maptools.org/">
  22. http://libtiff.maptools.org/</a>
  23. <HR SIZE=4 WIDTH=65% ALIGN=left>
  24. </UL>
  25. <P>
  26. This document describes the changes made to the software between the
  27. <I>previous</I> and <I>current</I> versions (see above). If you don't
  28. find something listed here, then it was not done in this timeframe, or
  29. it was not considered important enough to be mentioned. The following
  30. information is located here:
  31. <UL>
  32. <LI><A HREF="#highlights">Major Changes</A>
  33. <LI><A HREF="#configure">Changes in the software configuration</A>
  34. <LI><A HREF="#libtiff">Changes in libtiff</A>
  35. <LI><A HREF="#tools">Changes in the tools</A>
  36. <LI><A HREF="#contrib">Changes in the contrib area</A>
  37. </UL>
  38. <p>
  39. <P><HR WIDTH=65% ALIGN=left>
  40. <!--------------------------------------------------------------------------->
  41. <A NAME="highlights"><B><FONT SIZE=+3>M</FONT>AJOR CHANGES:</B></A>
  42. <UL>
  43. <LI> The libtiff tools bmp2tiff, gif2tiff, ras2tiff, sgi2tiff,
  44. sgisv, and ycbcr are completely removed from the distribution.
  45. These tools were written in the late 1980s and early 1990s for
  46. test and demonstration purposes. In some cases the tools were
  47. never updated to support updates to the file format, or the
  48. file formats are now rarely used. In all cases these tools
  49. increased the libtiff security and maintenance exposure beyond
  50. the value offered by the tool.
  51. </UL>
  52. <P><HR WIDTH=65% ALIGN=left>
  53. <!--------------------------------------------------------------------------->
  54. <A NAME="configure"><B><FONT SIZE=+3>C</FONT>HANGES IN THE SOFTWARE CONFIGURATION:</B></A>
  55. <UL>
  56. <LI> None
  57. </UL>
  58. <P><HR WIDTH=65% ALIGN=left>
  59. <!--------------------------------------------------------------------------->
  60. <A NAME="libtiff"><B><FONT SIZE=+3>C</FONT>HANGES IN LIBTIFF:</B></A>
  61. <UL>
  62. <LI> libtiff/tif_dirread.c: in TIFFFetchNormalTag(), do not
  63. dereference NULL pointer when values of tags with
  64. TIFF_SETGET_C16_ASCII / TIFF_SETGET_C32_ASCII access are
  65. 0-byte arrays. Fixes
  66. http://bugzilla.maptools.org/show_bug.cgi?id=2593 (regression
  67. introduced by previous fix done on 2016-11-11 for
  68. CVE-2016-9297). Reported by Henri Salo. Assigned as
  69. CVE-2016-9448
  70. <LI> libtiff/tif_aux.c: fix crash in TIFFVGetFieldDefaulted() when
  71. requesting Predictor tag and that the zip/lzw codec is not
  72. configured. Fixes
  73. http://bugzilla.maptools.org/show_bug.cgi?id=2591
  74. <LI> libtiff/tif_dirread.c: in TIFFFetchNormalTag(), make sure
  75. that values of tags with TIFF_SETGET_C16_ASCII /
  76. TIFF_SETGET_C32_ASCII access are null terminated, to avoid
  77. potential read outside buffer in _TIFFPrintField(). Fixes
  78. http://bugzilla.maptools.org/show_bug.cgi?id=2590
  79. <LI> libtiff/tif_dirread.c: reject images with OJPEG compression
  80. that have no TileOffsets/StripOffsets tag, when OJPEG
  81. compression is disabled. Prevent null pointer dereference in
  82. TIFFReadRawStrip1() and other functions that expect
  83. td_stripbytecount to be non NULL. Fixes
  84. http://bugzilla.maptools.org/show_bug.cgi?id=2585
  85. <LI> libtiff/tif_strip.c: make TIFFNumberOfStrips() return the
  86. td->td_nstrips value when it is non-zero, instead of
  87. recomputing it. This is needed in TIFF_STRIPCHOP mode where
  88. td_nstrips is modified. Fixes a read outsize of array in
  89. tiffsplit (or other utilities using TIFFNumberOfStrips()).
  90. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2587
  91. (CVE-2016-9273)
  92. <LI> libtiff/tif_predict.h, libtiff/tif_predict.c: Replace
  93. assertions by runtime checks to avoid assertions in debug
  94. mode, or buffer overflows in release mode. Can happen when
  95. dealing with unusual tile size like YCbCr with
  96. subsampling. Reported as MSVR 35105 by Axel Souchet & Vishal
  97. Chauhan from the MSRC Vulnerabilities & Mitigations
  98. <LI> libtiff/tif_dir.c: discard values of SMinSampleValue and
  99. SMaxSampleValue when they have been read and the value of
  100. SamplesPerPixel is changed afterwards (like when reading a
  101. OJPEG compressed image with a missing SamplesPerPixel tag, and
  102. whose photometric is RGB or YCbCr, forcing SamplesPerPixel
  103. being 3). Otherwise when rewriting the directory (for example
  104. with tiffset, we will expect 3 values whereas the array had
  105. been allocated with just one), thus causing a out of bound
  106. read access. Fixes
  107. http://bugzilla.maptools.org/show_bug.cgi?id=2500
  108. (CVE-2014-8127, duplicate: CVE-2016-3658)
  109. <LI> libtiff/tif_dirwrite.c: avoid null pointer dereference on
  110. td_stripoffset when writing directory, if FIELD_STRIPOFFSETS
  111. was artificially set for a hack case in OJPEG case. Fixes
  112. http://bugzilla.maptools.org/show_bug.cgi?id=2500
  113. (CVE-2014-8127, duplicate: CVE-2016-3658)
  114. <LI> libtiff/tif_getimage.c (TIFFRGBAImageOK): Reject attempts to
  115. read floating point images.
  116. <LI> libtiff/tif_predict.c (PredictorSetup): Enforce
  117. bits-per-sample requirements of floating point predictor (3).
  118. Fixes CVE-2016-3622 "Divide By Zero in the tiff2rgba tool."
  119. <LI> libtiff/tif_pixarlog.c: fix out-of-bounds write vulnerabilities
  120. in heap allocated buffers. Reported as MSVR 35094. Discovered by
  121. Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
  122. Mitigations team.
  123. <LI> libtiff/tif_write.c: fix issue in error code path of
  124. TIFFFlushData1() that didn't reset the tif_rawcc and tif_rawcp
  125. members. I'm not completely sure if that could happen in
  126. practice outside of the odd behaviour of t2p_seekproc() of
  127. tiff2pdf). The report points that a better fix could be to
  128. check the return value of TIFFFlushData1() in places where it
  129. isn't done currently, but it seems this patch is enough.
  130. Reported as MSVR 35095. Discovered by Axel Souchet & Vishal
  131. Chauhan & Suha Can from the MSRC Vulnerabilities & Mitigations
  132. team.
  133. <LI> libtiff/tif_pixarlog.c: Fix write buffer overflow in
  134. PixarLogEncode if more input samples are provided than
  135. expected by PixarLogSetupEncode. Idea based on
  136. libtiff-CVE-2016-3990.patch from
  137. libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro, but with
  138. different and simpler check. (bugzilla #2544)
  139. <LI> libtiff/tif_read.c: Fix out-of-bounds read on memory-mapped
  140. files in TIFFReadRawStrip1() and TIFFReadRawTile1() when
  141. stripoffset is beyond tmsize_t max value (reported by Mathias
  142. Svensson)
  143. <LI> libtiff/tif_read.c: make TIFFReadEncodedStrip() and
  144. TIFFReadEncodedTile() directly use user provided buffer when
  145. no compression (and other conditions) to save a memcpy()
  146. <LI> libtiff/tif_write.c: make TIFFWriteEncodedStrip() and
  147. TIFFWriteEncodedTile() directly use user provided buffer when
  148. no compression to save a memcpy().
  149. <LI> libtiff/tif_luv.c: validate that for COMPRESSION_SGILOG and
  150. PHOTOMETRIC_LOGL, there is only one sample per pixel. Avoid
  151. potential invalid memory write on corrupted/unexpected images
  152. when using the TIFFRGBAImageBegin() interface (reported by
  153. Clay Wood)
  154. <LI> libtiff/tif_pixarlog.c: fix potential buffer write overrun in
  155. PixarLogDecode() on corrupted/unexpected images (reported by
  156. Mathias Svensson) (CVE-2016-5875)
  157. <LI> libtiff/libtiff.def: Added _TIFFMultiply32 and
  158. _TIFFMultiply64 to libtiff.def
  159. <LI> libtiff/tif_config.vc.h (HAVE_SNPRINTF): Add a '1' to the
  160. HAVE_SNPRINTF definition.
  161. <LI> libtiff/tif_config.vc.h (HAVE_SNPRINTF): Applied patch by
  162. Edward Lam to define HAVE_SNPRINTF for Visual Studio 2015.
  163. <LI> libtiff/tif_dirread.c: when compiled with DEFER_STRILE_LOAD,
  164. fix regression, introduced on 2014-12-23, when reading a
  165. one-strip file without a StripByteCounts tag. GDAL #6490
  166. <LI> libtiff/*: upstream typo fixes (mostly contributed by Kurt
  167. Schwehr) coming from GDAL internal libtiff
  168. <LI> libtiff/tif_fax3.h: make Param member of TIFFFaxTabEnt
  169. structure a uint16 to reduce size of the binary.
  170. <LI> libtiff/tif_read.c, tif_dirread.c: fix indentation issues
  171. raised by GCC 6 -Wmisleading-indentation
  172. <LI> libtiff/tif_pixarlog.c: avoid zlib error messages to pass a
  173. NULL string to %s formatter, which is undefined behaviour in
  174. sprintf().
  175. <LI> libtiff/tif_next.c: fix potential out-of-bound write in NeXTDecode()
  176. triggered by http://lcamtuf.coredump.cx/afl/vulns/libtiff5.tif
  177. (bugzilla #2508)
  178. <LI> libtiff/tif_luv.c: fix potential out-of-bound writes in
  179. decode functions in non debug builds by replacing assert()s by
  180. regular if checks (bugzilla #2522). Fix potential
  181. out-of-bound reads in case of short input data.
  182. <LI> libtiff/tif_getimage.c: fix out-of-bound reads in
  183. TIFFRGBAImage interface in case of unsupported values of
  184. SamplesPerPixel/ExtraSamples for LogLUV / CIELab. Add explicit
  185. call to TIFFRGBAImageOK() in TIFFRGBAImageBegin(). Fix
  186. CVE-2015-8665 reported by limingxing and CVE-2015-8683
  187. reported by zzf of Alibaba.
  188. <LI> libtiff/tif_dirread.c: workaround false positive warning of
  189. Clang Static Analyzer about null pointer dereference in
  190. TIFFCheckDirOffset().
  191. <LI> libtiff/tif_fax3.c: remove dead assignment in
  192. Fax3PutEOLgdal(). Found by Clang Static Analyzer
  193. <LI> libtiff/tif_dirwrite.c: fix truncation to 32 bit of file
  194. offsets in TIFFLinkDirectory() and TIFFWriteDirectorySec()
  195. when aligning directory offsets on a even offset (affects
  196. BigTIFF). This was a regression of the changeset of
  197. 2015-10-19.
  198. <LI> libtiff/tif_write.c: TIFFWriteEncodedStrip() and
  199. TIFFWriteEncodedTile() should return -1 in case of failure of
  200. tif_encodestrip() as documented
  201. <LI> libtiff/tif_dumpmode.c: DumpModeEncode() should return 0 in
  202. case of failure so that the above mentioned functions detect
  203. the error.
  204. <LI> libtiff/*.c: fix MSVC warnings related to cast shortening and
  205. assignment within conditional expression
  206. <LI> libtiff/*.c: fix clang -Wshorten-64-to-32 warnings
  207. <LI> libtiff/tif_dirread.c: prevent reading ColorMap or
  208. TransferFunction if BitsPerPixel > 24, so as to avoid huge
  209. memory allocation and file read attempts
  210. <LI> libtiff/tif_dirread.c: remove duplicated assignment (reported
  211. by Clang static analyzer)
  212. <LI> libtiff/tif_dir.c, libtiff/tif_dirinfo.c,
  213. libtiff/tif_compress.c, libtiff/tif_jpeg_12.c: suppress
  214. warnings about 'no previous declaration/prototype'
  215. <LI> libtiff/tiffiop.h, libtiff/tif_dirwrite.c: suffix constants
  216. by U to fix 'warning: negative integer implicitly converted to
  217. unsigned type' warning (part of -Wconversion)
  218. <LI> libtiff/tif_dir.c, libtiff/tif_dirread.c,
  219. libtiff/tif_getimage.c, libtiff/tif_print.c: fix -Wshadow
  220. warnings (only in libtiff/)
  221. </UL>
  222. <P><HR WIDTH=65% ALIGN=left>
  223. <!-------------------------------------------------------------------------->
  224. <A NAME="tools"><B><FONT SIZE=+3>C</FONT>HANGES IN THE TOOLS:</B></A>
  225. <UL>
  226. <LI> tools/Makefile.am: The libtiff tools bmp2tiff, gif2tiff,
  227. ras2tiff, sgi2tiff, sgisv, and ycbcr are completely removed
  228. from the distribution. The libtiff tools rgb2ycbcr and
  229. thumbnail are only built in the build tree for testing. Old
  230. files are put in new 'archive' subdirectory of the source
  231. repository, but not in distribution archives. These changes
  232. are made in order to lessen the maintenance burden.
  233. <LI> tools/tiff2pdf.c: avoid undefined behaviour related to
  234. overlapping of source and destination buffer in memcpy() call
  235. in t2p_sample_rgbaa_to_rgb() Fixes
  236. http://bugzilla.maptools.org/show_bug.cgi?id=2577
  237. <LI> tools/tiff2pdf.c: fix potential integer overflows on 32 bit
  238. builds in t2p_read_tiff_size() Fixes
  239. http://bugzilla.maptools.org/show_bug.cgi?id=2576
  240. <LI> tools/fax2tiff.c: fix segfault when specifying -r without
  241. argument. Patch by Yuriy M. Kaminskiy. Fixes
  242. http://bugzilla.maptools.org/show_bug.cgi?id=2572
  243. <LI> tools/tiffinfo.c: fix out-of-bound read on some tiled images.
  244. (http://bugzilla.maptools.org/show_bug.cgi?id=2517)
  245. <LI> tools/tiffcrop.c: fix multiple uint32 overflows in
  246. writeBufferToSeparateStrips(), writeBufferToContigTiles() and
  247. writeBufferToSeparateTiles() that could cause heap buffer
  248. overflows. Reported by Henri Salo from Nixu Corporation.
  249. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2592
  250. <LI> tools/tiffcrop.c: fix out-of-bound read of up to 3 bytes in
  251. readContigTilesIntoBuffer(). Reported as MSVR 35092 by Axel
  252. Souchet & Vishal Chauhan from the MSRC Vulnerabilities &
  253. Mitigations team.
  254. <LI> tools/tiff2pdf.c: fix write buffer overflow of 2 bytes on
  255. JPEG compressed images. Reported by Tyler Bohan of Cisco Talos
  256. as TALOS-CAN-0187 / CVE-2016-5652. Also prevents writing 2
  257. extra uninitialized bytes to the file stream.
  258. <LI> tools/tiffcp.c: fix out-of-bounds write on tiled images with odd
  259. tile width vs image width. Reported as MSVR 35103
  260. by Axel Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
  261. Mitigations team.
  262. <LI> tools/tiff2pdf.c: fix read -largely- outsize of buffer in
  263. t2p_readwrite_pdf_image_tile(), causing crash, when reading a
  264. JPEG compressed image with TIFFTAG_JPEGTABLES length being
  265. one. Reported as MSVR 35101 by Axel Souchet and Vishal
  266. Chauhan from the MSRC Vulnerabilities & Mitigations team.
  267. <LI> tools/tiffcp.c: fix read of undefined variable in case of
  268. missing required tags. Found on test case of MSVR 35100.
  269. <LI> tools/tiffcrop.c: fix read of undefined buffer in
  270. readContigStripsIntoBuffer() due to uint16 overflow. Probably
  271. not a security issue but I can be wrong. Reported as MSVR
  272. 35100 by Axel Souchet from the MSRC Vulnerabilities &
  273. Mitigations team.
  274. <LI> tools/tiffcrop.c: fix various out-of-bounds write
  275. vulnerabilities in heap or stack allocated buffers. Reported
  276. as MSVR 35093, MSVR 35096 and MSVR 35097. Discovered by Axel
  277. Souchet and Vishal Chauhan from the MSRC Vulnerabilities &
  278. Mitigations team.
  279. <LI> tools/tiff2pdf.c: fix out-of-bounds write vulnerabilities in
  280. heap allocate buffer in t2p_process_jpeg_strip(). Reported as
  281. MSVR 35098. Discovered by Axel Souchet and Vishal Chauhan from
  282. the MSRC Vulnerabilities & Mitigations team.
  283. <LI> tools/tiff2bw.c: fix weight computation that could result of
  284. color value overflow (no security implication). Fix bugzilla
  285. #2550. Patch by Frank Freudenberg.
  286. <LI> tools/rgb2ycbcr.c: validate values of -v and -h parameters to
  287. avoid potential divide by zero. Fixes CVE-2016-3623 (bugzilla #2569)
  288. <LI> tools/tiffcrop.c: Fix out-of-bounds write in loadImage().
  289. From patch libtiff-CVE-2016-3991.patch from
  290. libtiff-4.0.3-25.el7_2.src.rpm by Nikola Forro (bugzilla
  291. #2543)
  292. <LI> tools/tiff2rgba.c: Fix integer overflow in size of allocated
  293. buffer, when -b mode is enabled, that could result in
  294. out-of-bounds write. Based initially on patch
  295. tiff-CVE-2016-3945.patch from libtiff-4.0.3-25.el7_2.src.rpm
  296. by Nikola Forro, with correction for invalid tests that
  297. rejected valid files. (bugzilla #2545)
  298. <LI> tools/tiffcrop.c: Avoid access outside of stack allocated
  299. array on a tiled separate TIFF with more than 8 samples per
  300. pixel. Reported by Kaixiang Zhang of the Cloud Security Team,
  301. Qihoo 360 (CVE-2016-5321 / CVE-2016-5323 , bugzilla #2558 /
  302. #2559)
  303. <LI> tools/tiffdump.c: fix a few misaligned 64-bit reads warned by
  304. -fsanitize
  305. <LI> tools/tiffdump.c (ReadDirectory): Remove uint32 cast to
  306. _TIFFmalloc() argument which resulted in Coverity report.
  307. Added more mutiplication overflow checks.
  308. </UL>
  309. <P><HR WIDTH=65% ALIGN=left>
  310. <!--------------------------------------------------------------------------->
  311. <A NAME="contrib"><B><FONT SIZE=+3>C</FONT>HANGES IN THE CONTRIB AREA:</B></A>
  312. <UL>
  313. <LI> None
  314. </UL>
  315. Last updated $Date: 2016-11-19 17:47:40 $.
  316. </BODY>
  317. </HTML>