<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>168917</bug_id>
          
          <creation_ts>2007-03-01 18:10 0000</creation_ts>
          <short_desc>media-video/mplayer DMO buffer overflow (CVE-2007-1246)</short_desc>
          <delta_ts>2007-05-30 19:44:58 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          <bug_file_loc>http://seclists.org/fulldisclosure/2007/Mar/0002.html</bug_file_loc>
          <status_whiteboard>B2 [glsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>keith@email.arizona.edu</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>media-video@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>keith@email.arizona.edu</who>
            <bug_when>2007-03-01 18:10:43 0000</bug_when>
            <thetext>There&apos;s an exploitable buffer overflow in the current version of
MPlayer (v1.0rc1) which can be exploited with a maliciously crafted
video file. It&apos;s hidden in the function DMO_VideoDecoder() in the
file loader/dmo/DMO_VideoDecoder.c. The variable format-&gt;biSize gets
its value directly from the video file, and thus can have any value
up to LONG_MAX. In line 136 it is used without any further checks as
the length argument to the memcpy() call, which can overflow the
this-&gt;m_sVhdr-&gt;bmiHeader buffer with data directly from the video file.

117 unsigned int bihs;
118
119 bihs = (format-&gt;biSize &lt; (int) sizeof(BITMAPINFOHEADER)) ?
120 sizeof(BITMAPINFOHEADER) : format-&gt;biSize;
121
122 this-&gt;iv.m_bh = malloc(bihs);
123 memcpy(this-&gt;iv.m_bh, format, bihs);
124
125 this-&gt;iv.m_State = STOP;
126 //this-&gt;iv.m_pFrame = 0;
127 this-&gt;iv.m_Mode = DIRECT;
128 this-&gt;iv.m_iDecpos = 0;
129 this-&gt;iv.m_iPlaypos = -1;
130 this-&gt;iv.m_fQuality = 0.0f;
131 this-&gt;iv.m_bCapable16b = true;
132
133 bihs += sizeof(VIDEOINFOHEADER) - sizeof(BITMAPINFOHEADER);
134 this-&gt;m_sVhdr = malloc(bihs);
135 memset(this-&gt;m_sVhdr, 0, bihs);
136 memcpy(&amp;this-&gt;m_sVhdr-&gt;bmiHeader, this-&gt;iv.m_bh, this-&gt;iv.m_bh-&gt;biSize);

This got fixed [1] in trunk two weeks ago. 

Reproducible: Didn&apos;t try</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beandog@gentoo.org</who>
            <bug_when>2007-03-01 18:49:51 0000</bug_when>
            <thetext>&quot;This got fixed [1] in trunk two weeks ago.&quot;

If anyone wants to find the patch, that&apos;d be great.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2007-03-02 08:32:44 0000</bug_when>
            <thetext>this looks like the patch:
http://svn.mplayerhq.hu/mplayer/trunk/loader/dmo/DMO_VideoDecoder.c?r1=22019&amp;r2=22204</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lu_zero@gentoo.org</who>
            <bug_when>2007-03-02 11:27:47 0000</bug_when>
            <thetext>I&apos;m thinking about adding a snapshot of ffmpeg and mplayer in the weekend</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dercorny@gentoo.org</who>
            <bug_when>2007-03-02 13:50:51 0000</bug_when>
            <thetext>i doubt this whole thing.

line 134 allocates memory based upon the value in bihs. due to line 119 and 120, this value should be ok (actually, a bit larger than format-&gt;biSize due to line 134). i see no way how format-&gt;biSize can be larger than the allocated memory.

comments?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>py@gentoo.org</who>
            <bug_when>2007-03-13 13:32:07 0000</bug_when>
            <thetext>According to http://secunia.com/advisories/24444/, this bug is now fixed in the SVN repository (CVE-2007-1246)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2007-03-15 21:58:03 0000</bug_when>
            <thetext>Luca or video-team any news on this?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beandog@gentoo.org</who>
            <bug_when>2007-03-16 00:42:14 0000</bug_when>
            <thetext>(In reply to comment #6)
&gt; Luca or video-team any news on this?
&gt; 

its a work in progress</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-04-04 07:54:00 0000</bug_when>
            <thetext>Is it just me or is this a dupe of #170208</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2007-04-09 18:49:41 0000</bug_when>
            <thetext>(In reply to comment #8)
&gt; Is it just me or is this a dupe of #170208
&gt; 

Same origin, but mplayer is still vulnerable. Video team, is your work going well?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-04-18 05:51:07 0000</bug_when>
            <thetext>Media-video any news on this one?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>beandog@gentoo.org</who>
            <bug_when>2007-04-26 15:53:28 0000</bug_when>
            <thetext>Finally fixed the naming scheme, mplayer-1.0.20070321 is our security fix.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2007-04-30 12:44:24 0000</bug_when>
            <thetext>Thx Beandog.

Arches please test and mark stable. Target keywords are:

mplayer-1.0.20070321.ebuild:KEYWORDS=&quot;alpha amd64 hppa ia64 ppc ppc64 sparc x86 ~x86-fbsd&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>armin76@gentoo.org</who>
            <bug_when>2007-04-30 15:25:23 0000</bug_when>
            <thetext>ia64 + x86 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kingtaco@gentoo.org</who>
            <bug_when>2007-04-30 15:37:51 0000</bug_when>
            <thetext>  26 Apr 2007; Steve Dibb &lt;beandog@gentoo.org&gt; mplayer-1.0.20070321.ebuild:
  amd64 stable
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gustavoz@gentoo.org</who>
            <bug_when>2007-04-30 21:10:17 0000</bug_when>
            <thetext>sparc stable.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>corsair@gentoo.org</who>
            <bug_when>2007-05-01 08:39:50 0000</bug_when>
            <thetext>ppc64 stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>kloeri@gentoo.org</who>
            <bug_when>2007-05-02 11:58:44 0000</bug_when>
            <thetext>Stable on Alpha.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jer@gentoo.org</who>
            <bug_when>2007-05-02 15:28:39 0000</bug_when>
            <thetext>Stable for HPPA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dertobi123@gentoo.org</who>
            <bug_when>2007-05-03 18:38:51 0000</bug_when>
            <thetext>ppc stable</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>falco@gentoo.org</who>
            <bug_when>2007-05-30 19:44:58 0000</bug_when>
            <thetext>200705-21 is out, thansk everybody</thetext>
          </long_desc>
      
    </bug>

</bugzilla>