安全研究

安全漏洞
LibTIFF LZWDecodeCompat()函数缓冲区溢出漏洞

发布日期:2009-06-21
更新日期:2009-06-23

受影响系统:
LibTIFF LibTIFF 3.8.2
描述:
BUGTRAQ  ID: 35451
CVE(CAN) ID: CVE-2009-2285

LibTiff是负责对TIFF图象格式进行编码/解码的应用库。

LibTiff库的libtiff/tif_lzw.c文件中的LZWDecodeCompat()函数在解析特制的TIFF文件时存在缓冲区溢出漏洞:

op += codep->length, occ -= codep->length;
tp = op;
do {
    *--tp = codep->value;
} while( (codep = codep->next) != NULL);

这部分的算法依赖于codep->next调用的次数与codep->length相同,也就是说如果能够让codep->length等于一个很小的值而多次调用codep->next,就可以在tp中触发溢出,例如:

258 [length : 1, next : 259]
259[length : 1, next 260] -> if it were correct, this one should have a length of 0 and next=NULL
260[length: 1, next : 261] ...

<*来源:wololo
  
  链接:http://secunia.com/advisories/35515/
        http://www.openwall.com/lists/oss-security/2009/06/22/1
        http://bugzilla.maptools.org/show_bug.cgi?format=multiple&id=2065
        http://www.lan.st/showthread.php?t=1856&page=3
        https://www.redhat.com/support/errata/RHSA-2009-1159.html
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

http://bugzilla.maptools.org/attachment.cgi?id=313

建议:
厂商补丁:

RedHat
------
RedHat已经为此发布了一个安全公告(RHSA-2009:1159-01)以及相应补丁:
RHSA-2009:1159-01:Moderate: libtiff security update
链接:https://www.redhat.com/support/errata/RHSA-2009-1159.html

LibTIFF
-------
目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:

http://bugzilla.maptools.org/attachment.cgi?id=314

浏览次数:2467
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障