[prev in list] [next in list] [prev in thread] [next in thread] 

List:       oss-security
Subject:    [oss-security] =?UTF-8?B?Q1ZFIHJlcXVlc3QgbGlidGlmZjogb3V0LW9mLWJvdW5kcyByZWFkIGluIENJRSBMYWIgaW1h?= 
From:       "=?UTF-8?B?6IyD56Wa6IezKOW6k+eJuSk=?=" <zuozhi.fzz () alibaba-inc ! com>
Date:       2015-12-25 10:02:39
Message-ID: b60b0b56-4be9-4f63-9cb2-4a1c28f36f09.zuozhi.fzz () alibaba-inc ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

If the data of image is packed(e.g., TIFFDirectory.td_samplesperpixel == \
1,TIFFDirectory.td_bitspersample == 8), a pixel only owns one byte. But in theimplementation of \
putcontig8bitCIELab, it eats 3 bytes per pixel. This willlead to an out-of-bounds read \
vulnerability.vuln code in tif_getimage.c, libtiff v4.0.61699 \
DECLAREContigPutFunc(putcontig8bitCIELab)1700 {1701         float X, Y, Z;1702         uint32 \
r, g, b;1703         (void) y;1704         fromskew *= 3;1705         while (h-- > 0) {1706     \
for (x = w; x-- > 0;) {1707                         TIFFCIELabToXYZ(img->cielab,1708            \
(unsigned char)pp[0],1709                                         (signed char)pp[1],1710       \
(signed char)pp[2],1711                                         &X, &Y, &Z);1712                \
TIFFXYZToRGB(img->cielab, X, Y, Z, &r, &g, &b);1713                         *cp++ = PACK(r, g, \
b);1714                         pp += 3;1715                 }1716                 cp += \
toskew;1717                 pp += fromskew;1718         }1719 }I use the tutorial code from \
http://www.remotesensing.org/libtiff/libtiff.htmlto test that, and poc is in the attachment.    \
#include "tiffio.h"    main(int argc, char* argv[])    {        TIFF* tif = TIFFOpen(argv[1], \
"r");        if (tif) {            TIFFRGBAImage img;            char emsg[1024];               \
if (TIFFRGBAImageBegin(&img, tif, 0, emsg)) {                size_t npixels;                \
uint32* raster;                                npixels = img.width * img.height;                \
raster = (uint32*) _TIFFmalloc(npixels * sizeof (uint32));                if (raster != NULL) { \
if (TIFFRGBAImageGet(&img, raster, img.width, img.height)) {                        ...process \
raster data...                    }                    _TIFFfree(raster);                }      \
TIFFRGBAImageEnd(&img);            } else                TIFFError(argv[1], emsg);            \
TIFFClose(tif);        }        exit(0);    }If it would be assigned a CVE, please credit it \
for: zzf of Alibaba.


[Attachment #5 (text/html)]

<div class="__aliyun_email_body_block"><div style="clear: both;"><span style="font-family: \
Tahoma, Arial, STHeiti, SimSun; font-size: 14px; color: rgb(0, 0, 0);"><span style="color: \
rgb(0, 0, 0); font-family: 'courier new'; font-size: \
10px;">If&nbsp;the&nbsp;data&nbsp;of&nbsp;image&nbsp;is&nbsp;packed(e.g.,&nbsp;TIFFDirectory.td_samplesperpixel&nbsp;==&nbsp;1,<br \
>TIFFDirectory.td_bitspersample&nbsp;==&nbsp;8),&nbsp;a&nbsp;pixel&nbsp;only&nbsp;owns&nbsp;one&nbsp;byte.&nbsp;But&nbsp;in&nbsp;the<br \
> >implementation&nbsp;of&nbsp;putcontig8bitCIELab,&nbsp;it&nbsp;eats&nbsp;3&nbsp;bytes&nbsp;per&nbsp;pixel.&nbsp;This&nbsp;will<br \
> > >lead&nbsp;to&nbsp;an&nbsp;out-of-bounds&nbsp;read&nbsp;vulnerability.<br ><br \
> > > >vuln&nbsp;code&nbsp;in&nbsp;tif_getimage.c,&nbsp;libtiff&nbsp;v4.0.6<br ><br \
> > > > >1699&nbsp;DECLAREContigPutFunc(putcontig8bitCIELab)<br >1700&nbsp;{<br \
> > > > > >1701&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;X,&nbsp;Y,&nbsp;Z;<br \
> > > > > > >1702&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;uint32&nbsp;r,&nbsp;g,&nbsp;b;<br \
> > > > > > > >1703&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(void)&nbsp;y;<br \
> > > > > > > > >1704&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fromskew&nbsp;*=&nbsp;3;<br \
> > > > > > > > > >1705&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(h--&nbsp;&gt;&nbsp;0)&nbsp;{<br \
> > > > > > > > > > >1706&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \
> > > > > > > > > > > \


["=?UTF-8?B?cG9jMDI5LnppcA==?=" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic