From owner-freebsd-ports@FreeBSD.ORG Fri Dec 17 12:20:37 2004 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B724216A4CE for ; Fri, 17 Dec 2004 12:20:37 +0000 (GMT) Received: from cowbert.2y.net (d46h180.public.uconn.edu [137.99.46.180]) by mx1.FreeBSD.org (Postfix) with SMTP id 279F543D58 for ; Fri, 17 Dec 2004 12:20:35 +0000 (GMT) (envelope-from sirmoo@cowbert.net) Received: (qmail 22232 invoked by uid 1001); 17 Dec 2004 12:20:34 -0000 Date: Fri, 17 Dec 2004 07:20:34 -0500 From: "Peter C. Lai" To: security-team@freebsd.org Message-ID: <20041217122034.GA1331@cowbert.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i cc: ports@freebsd.org cc: riggs@rrr.de Subject: Fwd: FW: iDEFENSE Security Advisory 12.16.04: MPlayer Bitmap Parsing Remote Heap Overflow Vulnerability X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Dec 2004 12:20:37 -0000 a candidate for vuxml? cc'd to ports@ and port maintainer. -----Original Message----- From: iDEFENSE Security Advisory [mailto:customerservice@idefense.com] Sent: Thursday, December 16, 2004 10:50 AM To: bugtraq@securityfocus.com Subject: iDEFENSE Security Advisory 12.16.04: MPlayer Bitmap Parsing Remote Heap Overflow Vulnerability MPlayer Bitmap Parsing Remote Heap Overflow Vulnerability iDEFENSE Security Advisory 12.16.04 http://www.idefense.com/application/poi/display?id=168 December 16, 2004 I. BACKGROUND MPlayer is a movie player for Linux that also runs on many other Unices, and non- x86 CPUs. It plays most MPEG, VOB, AVI, Ogg/OGM, VIVO, ASF/WMA/WMV, QT/MOV/MP4, FLI, RM, NuppelVideo, YUV4MPEG, FILM, RoQ, PVA files, supported by many native, XAnim, and Win32 DLL codecs. You can watch VideoCD, SVCD, DVD, 3ivx, DivX 3/4/5 and other formats. More information is available at http://mplayerhq.hu/. II. DESCRIPTION Remote exploitation of a heap overflow vulnerability in Unix MPlayer could allow attackers to gain access to the computer. The vulnerability specifically exists due to a lack of bounds checking within the demux_open_bmp() routine defined in /libmpdemux/demux_bmp.c. If a specially crafted file specifies a large value for the "biClrUsed" field, an overflow is triggered in stream_read(). The vulnerable portion of code is displayed here: demuxer_t* demux_open_bmp(demuxer_t* demuxer) { sh_video_t *sh_video = NULL; unsigned int filesize; unsigned int data_offset; bmp_image_t *bmp_image; ... sh_video->bih->biClrUsed = stream_read_dword_le(demuxer->stream); sh_video->bih->biClrImportant = stream_read_dword_le(demuxer->stream); // fetch the palette [!] stream_read(demuxer->stream, (unsigned char *)(sh_video->bih) + 40, sh_video->bih->biClrUsed * 4); ... } In the given example call to stream_read(), an unchecked amount of data as specified by "biClrUsed" will be read into the fixed size buffer "bih." This allows control of execution by overwriting the saved return address on the stack. III. ANALYSIS Successful exploitation of this vulnerability allows remote attackers to execute arbitrary code under the privileges of the user who attempted to view the bitmap file. Exploitation is not trivial, as a high level of precision is required. It is not a requirement for the malicious file to have an extension of .bmp because MPlayer will correctly determine if it is a bitmap file despite its extension. IV. DETECTION iDEFENSE has confirmed that MPlayer version 1.0pre5 is vulnerable. The following distributions of Linux include MPlayer: Debian Linux Fedora Linux Gentoo Linux SUSE Linux V. WORKAROUND Users must be careful when accepting and opening media from untrusted sources. VI. VENDOR RESPONSE A patch to address this vulnerability is available at: http://www1.mplayerhq.hu/MPlayer/patches/bmp_fix_20041215.diff VII. CVE INFORMATION A Mitre Corp. Common Vulnerabilities and Exposures (CVE) number has not been assigned yet. VIII. DISCLOSURE TIMELINE 12/10/2004 Initial vendor notification 12/16/2004 Public disclosure IX. CREDIT The discoverer of this vulnerability wishes to remain anonymous. Get paid for vulnerability research http://www.idefense.com/poi/teams/vcp.jsp X. LEGAL NOTICES Copyriht 2004 iDEFENSE, Inc. Permission is granted for the redistribution of this alert electronically. It may not be edited in any way without the express written consent of iDEFENSE. If you wish to reprint the whole or any part of this alert in any other medium other than electronically, please email customerservice@idefense.com for permission. Disclaimer: The information in the advisory is believed to be accurate at the time of publishing based on currently available information. Use of the information constitutes acceptance for use in an AS IS condition. There are no warranties with regard to this information. Neither the author nor the publisher accepts any liability for any direct, indirect, or consequential loss or damage arising from use of, or reliance on, this information. ----- End forwarded message ----- -- Peter C. Lai University of Connecticut Dept. of Molecular and Cell Biology Yale University School of Medicine SenseLab | Research Assistant http://cowbert.2y.net/