安全研究

安全漏洞
VideoLAN VLC媒体播放器远程溢出及格式串处理漏洞

发布日期:2007-12-24
更新日期:2007-12-25

受影响系统:
VideoLAN VLC Media Player <= 0.8.6b
描述:
BUGTRAQ  ID: 27015,28274
CVE(CAN) ID: CVE-2007-6681,CVE-2007-6682,CVE-2008-1881

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

VLC Media Player处理用户请求数据时存在缓冲区溢出漏洞,远程攻击者可能利用此漏洞通过诱使用户处理恶意数据控制用户系统。

---------------------------------------------------
A] 字幕处理缓冲区溢出
---------------------------------------------------

VLC在处理字幕时仅检查是否存在与加载视频同名的ssa文件及可能的字幕文件夹。用于处理MicroDvd、SSA和Vplayer字幕格式的函数中存在多个栈溢出漏洞,可能允许攻击者执行任意代码。modules\demux\subtitle.c文件中有漏洞的代码如下:

static int ParseMicroDvd( demux_t *p_demux, subtitle_t *p_subtitle )
    ...
    char buffer_text[MAX_LINE + 1];
    ...
        if( sscanf( s, "{%d}{}%[^\r\n]", &i_start, buffer_text ) == 2 ||
            sscanf( s, "{%d}{%d}%[^\r\n]", &i_start, &i_stop, buffer_text ) == 3)

static int  ParseSSA( demux_t *p_demux, subtitle_t *p_subtitle )
    ...
    char buffer_text[ 10 * MAX_LINE];
    char buffer_text2[ 10 * MAX_LINE];
    ...
        if( sscanf( s,
                    "Dialogue: %[^,],%d:%d:%d.%d,%d:%d:%d.%d,%[^\r\n]",
                    buffer_text2,
                    &h1, &m1, &s1, &c1,
                    &h2, &m2, &s2, &c2,
                    buffer_text ) == 10 )

static int  ParseVplayer( demux_t *p_demux, subtitle_t *p_subtitle )
    ...
    char buffer_text[MAX_LINE + 1];
    ...
        if( sscanf( p, "%d:%d:%d%[ :]%[^\r\n]", &h, &m, &s, &c, buffer_text ) == 5 )

-------------------------------------
B] Web接口格式串漏洞
-------------------------------------

可通过默认运行于8080端口的Web接口远程控制VLC。用于处理客户端所发送的Connection参数的指令缺少必要的格式参数便将内容传送给了httpd_MsgAdd函数,此外服务器在回复中发送回新形成的Connection字段,这有助于攻击者调整攻击,增加了成功攻击的概率。network\httpd.c文件中的有漏洞代码如下:

static int httpd_FileCallBack( httpd_callback_sys_t *p_sys, httpd_client_t *cl, \
                httpd_message_t *answer, httpd_message_t *query )
    ...
    psz_connection = httpd_MsgGet( &cl->query, "Connection" );
    if( psz_connection != NULL )
    {
        httpd_MsgAdd( answer, "Connection", psz_connection );
    }

<*来源:Luigi Auriemma (aluigi@pivx.com
  
  链接:http://marc.info/?l=bugtraq&m=119851714514157&w=2
        http://mailman.videolan.org/pipermail/vlc-devel/2007-June/032672.html
        http://secunia.com/advisories/28233/
        http://marc.info/?l=bugtraq&m=120577645702676&w=2
        http://security.gentoo.org/glsa/glsa-200803-13.xml
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

http://aluigi.org/poc/vlcboffs.zip
http://www.milw0rm.com/exploits/5519
http://www.milw0rm.com/exploits/5667

建议:
厂商补丁:

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

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

    # emerge --sync
    # emerge --ask --oneshot --verbose ">=media-video/vlc-0.8.6e"

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

http://trac.videolan.org/vlc/changeset/23839

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