CVE:CVE-2008-5314
CNNVD:CNNVD-200812-034
Clam AntiVirus是Unix的GPL杀毒工具包，很多邮件网关产品都在使用。
ClamAV的jpeg解析代码中存在递归栈溢出漏洞。如果用户扫描到了恶意的jpeg文件或文件缩略图，就会在没有检查递归限制的情况下调用有漏洞的cli_check_jpeg_exploit函数，触发栈溢出。以下是clamav-0.94\libclamav\special.c文件中的有漏洞代码段：
int cli_check_jpeg_exploit(int fd) <-- fd to jpeg file
{
...
             if ((retval=jpeg_check_photoshop(fd)) != 0) {
                           return retval;
                      }
...
}
...
static int jpeg_check_photoshop(int fd)
{
...
                retval = jpeg_check_photoshop_8bim(fd);
...
}
...
static int jpeg_check_photoshop_8bim(int fd)
{
...
        retval = cli_check_jpeg_exploit(fd); <-- calls cli_check_jpeg_exploit()
again without any recursive checks !
...
}
solution:Upgrade clam_anti-virus clamav to a higher version than 0.94.1,0.70,0.71,0.72,0.73,0.74,0.75,0.75.1,0.80,0.80:rc,0.80:rc2,0.80:rc3,0.80:rc4,0.81,0.81:rc1,0.82,0.83,0.84,0.84:rc1,0.84:rc2,0.85,0.85.1,0.86,0.86:rc1,0.86.1,0.86.2,0.87,0.87.1,0.88,0.88.1,0.88.2,0.88.3,0.88.4,0.88.5,0.88.6,0.88.7,0.90,0.90.1,0.90.2,0.90.3,0.91,0.91.1,0.91.2,0.92,0.92.1,0.93,0.93.1,0.93.3,0.94,and avoid the version (,0.94.1],0.70,0.71,0.72,0.73,0.74,0.75,0.75.1,0.80,0.80:rc,0.80:rc2,0.80:rc3,0.80:rc4,0.81,0.81:rc1,0.82,0.83,0.84,0.84:rc1,0.84:rc2,0.85,0.85.1,0.86,0.86:rc1,0.86.1,0.86.2,0.87,0.87.1,0.88,0.88.1,0.88.2,0.88.3,0.88.4,0.88.5,0.88.6,0.88.7,0.90,0.90.1,0.90.2,0.90.3,0.91,0.91.1,0.91.2,0.92,0.92.1,0.93,0.93.1,0.93.3,0.94