Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 201887
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Peter Volkov <pva@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 201887 depends on: Show dependency tree
Bug 201887 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-12-10 19:39 0000
Short version: The _LoadBMP function in imlib 1.9.15 and earlier allows
context-dependent attackers to cause a denial of service (infinite loop) via a
BMP image with a Bits Per Page (BPP) value of 0.

A bit longer:
=====================================================
The information has been provided by beSTORM.
The original article can be found at:
http://www.beyondsecurity.com/bestorm_overview.html

Vulnerable Systems:
 * imlib version 1.9.15 and prior

The _LoadBMP function reads from the BMP file the value of BPP (Bits Per Page)
and uses that value to know how many bits need to be read at each step of its
main file processing loop. The value of 0x0000 (zero) which is invalid, is not
properly detected as the line responsible:
if (bpp != 1 && bpp != 4 && bpp != 8 && bpp && 16 && bpp != 24 && bpp != 32)
{
fprintf(stderr, "IMLIB ERROR: unknown bitdepth in file\n");
return NULL;
}


Incorrectly references && bpp && where it shouldn't have probably referenced it
at all to prevent the value of 0x0000 from passing.

Since the bpp value of 0x0000 is used, the loop:
  for (line = (*h - 1); line >= 0; line--)
    {
      linepos = 0;
      for (column = 0; column < *w;)
    {

Will never advanced as no case inside the loop matches the bpp value of 0x0000.

Workaround:
Remove the && bpp && from the if statement found at line 648.

Vendor status:
We have tried to contact the security person responsible for the package in
Debian, but they haven't addressed it. We have sent an email to the author of
imlib on 2007-07-03 but the product appears to be no longer maintained by the
author as the last release was released on 2004-09-24.
=====================================================

Although I did not manage to get exploit seems that it's possibile to create
one. Thus I'm setting status to major.

------- Comment #1 From Peter Volkov 2007-12-10 20:15:16 0000 -------
Updated imlib-1.9.15-r2 which includes the fix is in portage. Please, review
and proceed as required.

------- Comment #2 From Peter Volkov 2007-12-12 20:32:31 0000 -------
Assigning on security as this is security issue.

------- Comment #3 From Pierre-Yves Rofes 2007-12-12 20:44:22 0000 -------
Thanks Peter. Arches, please test and mark stable media-libs/imlib-1.9.15-r2.
Target "alpha amd64 arm hppa ia64 mips ppc ppc64 sh sparc x86 ~x86-fbsd"

------- Comment #4 From Robert Buchholz 2007-12-13 01:26:12 0000 -------
Amd64, this also affects emul-linux-x86-gtklibs. Please update.

------- Comment #5 From Christian Faulhammer 2007-12-13 08:35:07 0000 -------
x86 stable

------- Comment #6 From Ferris McCormick 2007-12-13 16:22:38 0000 -------
Stable for sparc.

------- Comment #7 From Jeroen Roovers 2007-12-13 17:50:37 0000 -------
Stable for HPPA.

------- Comment #8 From Raúl Porcel 2007-12-13 20:26:15 0000 -------
alpha/ia64 stable

------- Comment #9 From Peter Weller 2007-12-14 07:16:34 0000 -------
Ebuild stable on amd64, emul stuff yet to come.

------- Comment #10 From Peter Weller 2007-12-14 07:40:46 0000 -------
Bumped app-emulation/emul-linux-x86-gtklibs - amd64 guys, please test and
stable. (If the tarball hasn't yet hit the mirrors, fetch it from here:
http://dev.gentoo.org/~welp/emul-linux-x86-gtklibs-20071214.tar.bz2)

------- Comment #11 From Markus Rothe 2007-12-14 11:09:13 0000 -------
ppc64 stable

------- Comment #12 From Tobias Scherbaum 2007-12-14 18:23:14 0000 -------
ppc stable

------- Comment #13 From Peter Weller 2007-12-15 14:40:00 0000 -------
emul-linux-x86-gtklibs-20071214 (which contains the fix) is stable on amd64,
thanks to gentoofan23 for testing.

------- Comment #14 From Robert Buchholz 2007-12-18 23:43:19 0000 -------
Ready for glsa vote.

------- Comment #15 From Robert Buchholz 2007-12-19 03:29:43 0000 -------
Since this library and function is very unlikely to be called from remote, I
vote NO here.

------- Comment #16 From Pierre-Yves Rofes 2007-12-19 08:44:23 0000 -------
no too, and closing.

------- Comment #17 From Peter Volkov 2008-03-06 09:58:27 0000 -------
Does not affect current (2008.0) release. Removing release.

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug