Bugzilla – Bug 1069213
VUL-1: CVE-2017-16232: tiff: memory-based DoS in tiff2bw
Last modified: 2018-11-21 23:39:55 UTC
CVE-2017-16232 LibTIFF 4.0.8 has multiple memory leak vulnerabilities, which allow attackers to cause a denial of service (memory consumption), as demonstrated by tif_open.c, tif_lzw.c, and tif_aux.c References: http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-16232 http://seclists.org/oss-sec/2017/q4/164 http://people.canonical.com/~ubuntu-security/cve/2017/CVE-2017-16232.html http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-16232
Created attachment 755813 [details] libtiff_poc_tif.bin QA REPRODUCER: tiff2bw libtiff_poc_tif.bin foo.tif will run quickly out of memory
this is partially in the tiff2bw tool itself where libtiff maitnainers do not want to fix it.
SUSE-SU-2018:0073-1: An update that fixes 5 vulnerabilities is now available. Category: security (important) Bug References: 1017690,1069213,960341,969783,983436 CVE References: CVE-2014-8128,CVE-2015-7554,CVE-2016-10095,CVE-2016-5318,CVE-2017-16232 Sources used: SUSE Linux Enterprise Software Development Kit 12-SP3 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Software Development Kit 12-SP2 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Server for Raspberry Pi 12-SP2 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Server 12-SP3 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Server 12-SP2 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Desktop 12-SP3 (src): tiff-4.0.9-44.7.1 SUSE Linux Enterprise Desktop 12-SP2 (src): tiff-4.0.9-44.7.1
openSUSE-SU-2018:0097-1: An update that fixes 5 vulnerabilities is now available. Category: security (important) Bug References: 1017690,1069213,960341,969783,983436 CVE References: CVE-2014-8128,CVE-2015-7554,CVE-2016-10095,CVE-2016-5318,CVE-2017-16232 Sources used: openSUSE Leap 42.3 (src): tiff-4.0.9-24.1 openSUSE Leap 42.2 (src): tiff-4.0.9-17.9.1
4.0.10, 4.0.9: $ valgrind -q --leak-check=full tiff2bw libtiff_poc_tif.bin foo.tif LZWDecode: Not enough data at scanline 0 (short 6442443006 bytes). $ Neither ASAN reports an error. 4.0.8: $ valgrind -q --leak-check=full tiff2bw libtiff_poc_tif.bin out.tiff LZWDecode: Not enough data at scanline 0 (short 6442443006 bytes). ==22463== 87,062 (1,100 direct, 85,962 indirect) bytes in 1 blocks are definitely lost in loss record 13 of 15 ==22463== at 0x4C2E08F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==22463== by 0x4E9D7AB: _TIFFmalloc (tif_unix.c:316) ==22463== by 0x4E89A90: TIFFClientOpen (tif_open.c:119) ==22463== by 0x4E9D655: TIFFFdOpen (tif_unix.c:211) ==22463== by 0x4E9D76A: TIFFOpen (tif_unix.c:250) ==22463== by 0x109642: main (tiff2bw.c:159) ==22463== ==22463== 2,147,483,702 bytes in 1 blocks are possibly lost in loss record 14 of 15 ==22463== at 0x4C2E08F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==22463== by 0x4E9D7AB: _TIFFmalloc (tif_unix.c:316) ==22463== by 0x109B5A: main (tiff2bw.c:225) ==22463== ==22463== 6,442,451,106 bytes in 1 blocks are possibly lost in loss record 15 of 15 ==22463== at 0x4C2E08F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==22463== by 0x4E9D7AB: _TIFFmalloc (tif_unix.c:316) ==22463== by 0x109EA6: main (tiff2bw.c:258) ==22463== $ The leaks are caused by not calling TIFFClose() on `in´ and TIFFfree() on inbuf and outbuf in error path. 3.8.2 $ valgrind -q --leak-check=full tiff2bw libtiff_poc_tif.bin out.tif libtiff_poc_tif.bin: Integer overflow in TIFFScanlineSize. TIFFReadDirectory: libtiff_poc_tif.bin: cannot handle zero scanline size. $ However, there are many possible memory leaks in 3.8.2/tools/tiff2bw.c's main(). While this is not an issue the more it is not a security one, closing as UPSTREAM.