Bugzilla – Bug 59081
VUL-0: CVE-2004-0827: imagemagick: convert crashes on bad BMPs
Last modified: 2021-10-02 09:53:08 UTC
convert, like QT crashes on bad BMPs. $ convert CAN-2004-0691.bmp foo.jpg Segmentation fault $
<!-- SBZ_reproduce --> convert CAN-2004-0691.bmp foo.jpg
Created attachment 22839 [details] CAN-2004-0691.bmp
Created attachment 22867 [details] This patch fixes it.
vladimir? Can you provide updated packages with this patch for sles8(8.1), sles9(9.1), 8.2, and 9.0 please?
Can you please provide the patchinfo files?
yes, i will prepare them
I submitted ImageMagick-devel.maintained ImageMagick-devel.patch.box ImageMagick.maintained to done/PATCHINFO.
packages submitted
thanks!
Date: Mon, 30 Aug 2004 16:32:03 +0200 From: Martin Schulze <joey@infodrom.org> To: Marcus Meissner <meissner@suse.de> Cc: vendor-sec@lst.de Subject: Re: crash in BMP handler User-Agent: Mutt/1.5.6+20040818i Marcus Meissner wrote: > It most likely has security implications, since this is the sample > QT BMP exploit image. > > Our ImageMagick maintainer Vladimir Nadvornik also supplied the attached > patch to fix the problem. > > We (SUSE) consider this issue public, since there are lots of sample > exploit BMPs already floating around. > + count=Min(count, end - q); I was told that Min is not typesafe (haven't checked on my own yet) and compared signed with unsigned values. Very large images (> 2GB) resulted a bogus, negative minimum value. This leads to incorrert images, but stays within bounds, on 32bit archs. On 64bit archs the heap buffer can overflow. We'll use the following thus: + count=Min((unsigned long) count, end - q); Upstream also fixed the AVI handler. Regards, Joey
This is the definition of Min: #define Min(x,y) (((x) < (y)) ? (x) : (y)) The avi handler contains the same code as bmp handler.
Created attachment 23046 [details] new patch
fixed pacvkages released
CAN-2004-0827
CVE-2004-0827: CVSS v2 Base Score: 7.5 (AV:N/AC:L/Au:N/C:P/I:P/A:P)