安全研究

安全漏洞
VLC媒体播放器Real解码器堆溢出漏洞

发布日期:2008-11-30
更新日期:2008-12-02

受影响系统:
VideoLAN VLC Media Player 0.9.0 - 0.9.7
不受影响系统:
VideoLAN VLC Media Player 0.9.8
描述:
BUGTRAQ  ID: 32545
CVE(CAN) ID: CVE-2008-5276

VLC Media Player是一款免费的媒体播放器。

VLC媒体播放器的modules/demux/real.c文件中的ReadRealIndex()函数在解析RealMedia(.rm)文件时存在最终可能导致堆溢出的整数溢出漏洞:

[...]
891 static void ReadRealIndex( demux_t *p_demux )
892 {
...
900 uint32_t i_index_count;
...
920 [1] i_index_count = GetDWBE( &buffer[10] );
...
931 [2] p_sys->p_index =
932 (rm_index_t *)malloc( sizeof( rm_index_t ) *
(i_index_count+1) );
933 if( p_sys->p_index == NULL )
934 return;
935
936 memset(p_sys->p_index, 0, sizeof(rm_index_t) * (i_index_count+1));
937
938 [3] for( i=0; i<i_index_count; i++ )
939 {
940 if( stream_Read( p_demux->s, buffer, 14 ) < 14 )
941 return ;
942
943 [7] if( GetWBE( &buffer[0] ) != 0 )
944 {
945 msg_Dbg( p_demux, "Real Index: invaild version of index
entry %d ",
946 GetWBE( &buffer[0] ) );
947 return;
948 }
949
950 [4] p_sys->p_index[i].time_offset = GetDWBE( &buffer[2] );
951 [5] p_sys->p_index[i].file_offset = GetDWBE( &buffer[6] );
952 [6] p_sys->p_index[i].frame_index = GetDWBE( &buffer[10] );
953 msg_Dbg( p_demux, "Real Index: time %d file %d frame %d ",
954 p_sys->p_index[i].time_offset,
955 p_sys->p_index[i].file_offset,
956 p_sys->p_index[i].frame_index );
957
958 }
959 }
[...]

[1] 将从RealMedia文件获得的用户控制数据拷贝到了i_index_count。
[2] i_index_count的值用于计算堆缓冲区的大小。如果该值足够大(如0x15555555),就可能在计算堆缓冲区大小时出现整数溢出,因此可能会分配较小的堆缓冲区。
[3] i_index_count的值用作这个for()循环中的计数器。
[4] 将从RealMedia文件获得的用户控制数据拷贝到了之前分配的堆缓冲区。由于i用作的数组索引,在i < i_index_count之前会执行for()循环,因此可以通过用户控制的数据覆盖堆缓冲区。
[5] 参考[4]
[6] 参考[4]

由于还可以触发能够在任意点停止溢出的退出条件(见[7]),这可能导致完全可控的堆溢出。远程攻击者可以以VLC环境执行任意代码。

<*来源:Tobias Klein
  
  链接:http://secunia.com/advisories/32942/
        http://www.videolan.org/security/sa0811.html
        http://www.trapkit.de/advisories/TKADV2008-013.txt
        http://security.gentoo.org/glsa/glsa-200812-24.xml
*>

建议:
厂商补丁:

Gentoo
------
Gentoo已经为此发布了一个安全公告(GLSA-200812-24)以及相应补丁:
GLSA-200812-24:VLC: Multiple vulnerabilities
链接:http://security.gentoo.org/glsa/glsa-200812-24.xml

所有VLC用户都应升级到最新版本:

    # emerge --sync
    # emerge --ask --oneshot --verbose ">=3Dmedia-video/vlc-0.9.8a"

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

http://www.videolan.org/vlc/

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