LibTIFF:memory leak in _TIFFmalloc


Description

LibTIFF This software provides support for the Tag Image File Format (TIFF), a widely used format for storing image data. The latest version of the TIFF specification is available on-line in several different formats.

A memory leak vulnerability was found in function _TIFFmalloc in tif_unix.c,which allows attackers to cause a denial of service via a crafted file.

tiff2pdf $FILE -o out.pdf

==28111==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 8 byte(s) in 1 object(s) allocated from:
   #0 0x7f8063966bb8 in __interceptor_malloc
../../../../libsanitizer/asan/asan_malloc_linux.cc:62
   #1 0x507dd3 in _TIFFmalloc
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_unix.c:316
   #2 0x452057 in TIFFReadDirEntryLong8Array
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_dirread.c:1919
   #3 0x464d88 in TIFFFetchStripThing
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_dirread.c:5402
   #4 0x45a226 in TIFFReadDirectory
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_dirread.c:3737
   #5 0x4dc630 in TIFFClientOpen
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_open.c:466
   #6 0x507b43 in TIFFFdOpen
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_unix.c:211
   #7 0x507d92 in TIFFOpen
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/libtiff/tif_unix.c:250
   #8 0x404065 in main
/home/haojun/Downloads/testopensourcecode/tiff-4.0.7/tools/tiff2pdf.c:751
   #9 0x7f8062b72b34 in __libc_start_main (/lib64/libc.so.6+0x21b34)

SUMMARY: AddressSanitizer: 8 byte(s) leaked in 1 allocation(s).
Affected version:4.0.7
Fixed version:N/A
Commit fix:N/A
Credit: ADLab of Venustech.
CVE:N/A
Reproducer:
https://github.com/bestshow/p0cs/blob/master/memory-leak-in-tiff2pdf-2.tif
Timeline:
2017-04-20:bug discovered and reported upstream bugzilla
2017-06-21:blog post about the issue
Permalink:
http://somevulnsofadlab.blogspot.com/2017/06/libtiffmemory-leak-in-tiffmalloc.html

评论

此博客中的热门博文

lrzip:stack buffer overflow in get_fileinfo

Poppler:stack buffer overflow in GfxImageColorMap::getGray

libming:memory leak in parseSWF_DOACTION