NASA BigView PNM文件处理栈溢出漏洞 CVE-2008-2542 CNNVD-200806-093 CNVD-2008-2765

6.8 AV AC AU C I A
发布: 2008-06-05
修订: 2018-10-11

BigView是NASA开发的图形查看器,可在运行Linux的桌面PC上将图形拉伸和缩放到任意尺寸。 BigView在解析特制的PNM输入文件时存在栈溢出漏洞,攻击者可能利用此漏洞通过诱使用户处理恶意文件控制用户系统。 以下是Ppm/ppm.C文件中的漏洞代码。这里getline()函数从文件将数据读取到缓冲区: /----------- 418 static void getline(int fin, char* lineBuf, int len) 419 { 420bool done=false; 421int index=0; 422lineBuf[index]=\'\'\'\'; 423 while(! done){ 424 lineBuf[index] = getOneChar(fin); 425if( lineBuf[index]==10 ) { 426lineBuf[index]=0; 427done=true; 428} 429 ++index; 430 } 431 lineBuf[index]=0; 432 } - -----------/ 函数要求了目标缓冲区的长度,但没有内部使用。在PPM::ppmHeader()函数中使用了上述函数来读取PPM文件的头: /----------- 56PPM::ppmHeader(string filename, PPM::Format* format, 57int* cpp, int* bpc, 58int* sizeX, int* sizeY, 59int* imageOffset) 60{ 61std::ostringstream err; 62char magic[3],lineBuf[512],junk; 63int res,max; . . . 115while( junk == \'\'\'\' ){ 116getline(fin,lineBuf,512); 117cout<< \"Comment:\"<<lineBuf<<\":\"<<endl; 118junk = getOneChar(fin); 119} - -----------/ 栈上所分配的lineBuf缓冲区大小为512字节,如果PPM头中包含有大于512字节的行的话,就会触发栈溢出,导致拒绝服务或执行任意指令。

0%
当前有3条漏洞利用/PoC
当前有1条受影响产品信息