当前位置:首页">"安全播报">"最新漏洞">"正文
Winamp S3M模块IN_MOD.DLL远程堆溢出漏洞
                                                                      浏览次数:

受影响系统:
Nullsoft Winamp 5.33
描述:
--------------------------------------------------------------------------------
BUGTRAQ ID: 23350

Winamp是一款流行的媒体播放器,支持多种文件格式。

Winamp在试图播放特质的.S3M文件时存在对溢出漏洞。在以下代码段中:

----// SNIP SNIP //-------------------------------------------------
.text:00E9BB54 write_loop: ; CODE XREF: sub_E9B964+239j
.text:00E9BB54 mov edx, [ebp+arg_0]
.text:00E9BB57 mov ecx, [esi+18h]
.text:00E9BB5A mov dx, [eax+edx*2]
.text:00E9BB5E mov [eax+ecx*2], dx
.text:00E9BB62 mov eax, [esi+370h]
.text:00E9BB68 mov ecx, [esi+18h]
.text:00E9BB6B mov cx, [eax+ecx*2]
.text:00E9BB6F cmp cx, [ebx+24h]
.text:00E9BB73 jnb short loc_E9BB93 ; *(0)
.text:00E9BB75 mov al, [esi+18h]
.text:00E9BB78 mov ecx, [ebp+arg_0]
.text:00E9BB7B mov [ecx+ebx+0A8h], al : *(A)
.text:00E9BB82 mov eax, [esi+370h]
.text:00E9BB88 cmp word ptr [eax+ecx*2], 0FEh
.text:00E9BB8E jnb short loc_E9BB93
.text:00E9BB90 inc dword ptr [esi+18h]
.text:00E9BB93
.text:00E9BB93 loc_E9BB93: ; CODE XREF: sub_E9B964+20Fj
.text:00E9BB93 ; sub_E9B964+22Aj

.text:00E9BB93 movzx ecx, word ptr [ebx+20h] ; *(B)
.text:00E9BB97 inc [ebp+arg_0]
.text:00E9BB9A cmp [ebp+arg_0], ecx ; *(C)
.text:00E9BB9D jb short write_loop
----// SNIP SNIP //-------------------------------------------------

其中
EBX = S3M头在内存中的基址
EBX+20h = S3M文件中0x20偏移
EBX+24h = S3M文件中0x24偏移
arg_0 = 计数器(每次循环加一,请见0x00E9BB97)

如果没有取指令*(0)处的跳转的话([eax+ecx*2]的dword值低于[ebx+24]的受控dword值),就会到达0x00E9BB75。al寄存器加载了[esi+18h]的一个字节(每次循环加1,请见0x00E9BB90)。然后在0x00E9BB78,ECX加载了计数器变量(也是每次循环加1)。标记为*(A)的指令将之前加载到AL中的字节储存到了通过EBX=memory_base/ECX = 线性计数器和将立即数地址设置为0xA8常量所计算出的内存位置。

在0x00E9BB93(标记为*(B)),CX等于用户在文件结构中(0x20偏移)控制的两个字节。重置ECX计数器为0,然后在*(C)将arg_0计数器与ECX的值做了比较,如果低于(CF=1)的话循环就会继续。

可见通过更改[ebx+20h]的值就可以更改write_loop的循环数,这可能导致堆溢出。

此外在试图播放.IT文件时也存在类似漏洞:

----// SNIP SNIP //-------------------------------------------------
.text:00E97BCA write_looop: ; CODE XREF: sub_E97976+29Dj
.text:00E97BCA mov edx, [ebp+6Ch+arg_0]
.text:00E97BCD mov ecx, [ebx+18h]
.text:00E97BD0 mov dx, [eax+edx*2]
.text:00E97BD4 mov [eax+ecx*2], dx
.text:00E97BD8 mov eax, [ebx+370h]
.text:00E97BDE mov ecx, [ebx+18h]
.text:00E97BE1 mov cx, [eax+ecx*2]
.text:00E97BE5 cmp cx, [esi+6Eh]
.text:00E97BE9 jnb short loc_E97C09
.text:00E97BEB mov al, [ebx+18h]
.text:00E97BEE mov ecx, [ebp+6Ch+arg_0]
.text:00E97BF1 mov [ecx+esi+148h], al ; BANG
.text:00E97BF8 mov eax, [ebx+370h]
.text:00E97BFE cmp word ptr [eax+ecx*2], 0FEh
.text:00E97C04 jnb short loc_E97C09
.text:00E97C06 inc dword ptr [ebx+18h]
.text:00E97C09
.text:00E97C09 loc_E97C09: ; CODE XREF: sub_E97976+273j
.text:00E97C09 ; sub_E97976+28Ej
.text:00E97C09 movzx ecx, word ptr [esi+68h] ; ecx=controlled value (from offset 0x20)
.text:00E97C0D inc [ebp+6Ch+arg_0]
.text:00E97C10 cmp [ebp+6Ch+arg_0], ecx

本新闻共2页,当前在第1页  1  2  



                                                                                          【关闭