<<< Date Index >>>     <<< Thread Index >>>

[IP] Serious Windows vulnerability announced just before Christmas Eve



------ Forwarded Message
From: Brett Glass <brett@xxxxxxxxxx>
Date: Fri, 24 Dec 2004 16:48:43 -0700
To: <dave@xxxxxxxxxx>, Ip ip <ip@xxxxxxxxxxxxxx>
Subject: Serious Windows vulnerability announced just before Christmas Eve

Dave:

For IP. The implications of the attached security advisory are extremely
serious. 
Essentially, if you can send an image to a Windows machine for display (via
e-mail 
or a Web page), you can take over the machine. Completely.

The vulnerability is present in all of Microsoft's NT-derived operating
systems, with
the possible exception of XP with Service Pack 2.

The bug was announced just before Christmas Eve. Microsoft's campus is shut
down for
Christmas, which means that Microsoft is likely to be much slower to patch
it than 
malicious parties will be to exploit it. (We may well see a "Warhol Worm"
based on
the vulnerability within a day.) So, it might not be a bad idea to browse
the Web only 
with other systems (e.g. Macintosh) until after the holidays.

--Brett Glass

---------------------------



Mailing-List: contact bugtraq-help@xxxxxxxxxxxxxxxxx; run by ezmlm
Precedence: bulk
List-Id: <bugtraq.list-id.securityfocus.com>
List-Post: <mailto:bugtraq@xxxxxxxxxxxxxxxxx>
List-Help: <mailto:bugtraq-help@xxxxxxxxxxxxxxxxx>
List-Unsubscribe: <mailto:bugtraq-unsubscribe@xxxxxxxxxxxxxxxxx>
List-Subscribe: <mailto:bugtraq-subscribe@xxxxxxxxxxxxxxxxx>
Delivered-To: mailing list bugtraq@xxxxxxxxxxxxxxxxx
Delivered-To: moderator for bugtraq@xxxxxxxxxxxxxxxxx
Received: (qmail 1112 invoked from network); 23 Dec 2004 07:31:14 -0000
Date: 23 Dec 2004 14:58:01 -0000
Message-ID: <20041223145801.12136.qmail@xxxxxxxxxxxxxxxxxxxxx>
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)
From: flashsky fangxing <flashsky@xxxxxxxxxx>
To: bugtraq@xxxxxxxxxxxxxxxxx
Subject: Microsoft Windows LoadImage API Integer Buffer overflow
X-UIDL: 8F\"!Uj#"!Z"_!!HGD"!



[Security Advisory]
    
    
Advisory: [AD_LAB-04004]Microsoft Windows LoadImage API Integer Buffer
overflow
Class: Boundary Condition Error
DATE:12/20/2004
Remote: Yes
 
Vulnerable:
 Windows NT 
 Windows 2000 SP0
 Windows 2000 SP1
 Windows 2000 SP2
 Windows 2000 SP3
 Windows 2000 SP4
 Windows XP SP0
 Windows XP SP1
 Windows 2003
not vulnerable:
 No one knows:P
Vendor:
 www.microsoft.com
 

I.DESCRIPTION: 
-------------
 
An exploitable integer buffer overflow exists in the LoadImage API of the
USER32 Lib. This
function loads an icon, a cursor or a bitmap and then try to proceed the
image. If an attacker
sends a specially crafter bmp, cur, ico or ani file within an HTML page or
in an Email, it is
then possible to run arbitrary code on the affected system.
 
II.DETAILS:
----------
 
When the LoadImage API try to proceed the image, it directly uses the size
field in the image 
file and then add 4. So if we set the size of image between
0xfffffffc-0xffffffff, an integer buffer
overflow occurs. 
 
The function defines:
 
HANDLE LoadImage(
  HINSTANCE hinst,   // handle of the instance containing the image
  LPCTSTR lpszName,  // name or identifier of the image
  UINT uType,        // type of image
  int cxDesired,     // desired width
  int cyDesired,     // desired height
  UINT fuLoad        // load flags
);
 
lpszName is the handle to the image to load, uType specifies the type of
image to be loaded.
This parameter can be one of the following values:
 IMAGE_BITMAP Loads a bitmap.
 IMAGE_CURSOR Loads a cursor.
 IMAGE_ICON Loads an icon.
 
When LoadImage API try to parse the bmp,cur,ico,ani file format, it doesn't
implement any check
on the size field and add 4. Look at the code below:
 
    When use ANI or CUR:
       .text:77D56178                 mov     eax, [ebx+8]
//Direct read our size here:P
 .text:77D5617B                 mov     [ebp+dwResSize], eax
 .text:77D5617E                 jnz     short loc_77D56184
 .text:77D56180                 add     [ebp+dwResSize], 4             //add
4 int overflow...
 .text:77D56184
 .text:77D56184 loc_77D56184:                           ; CODE XREF:
sub_77D5608F+EFj
 .text:77D56184                 push    [ebp+dwResSize]
//allocate a wrong size
 .text:77D56187                 push    0
 .text:77D56189                 push    dword_77D5F1A0
 .text:77D5618F                 call    ds:RtlAllocateHeap
 
      Then use the fake size for memmov and lead the heap overflow:
       .text:77D561A9                 mov     ecx, [ebx+8]
 .text:77D561AC                 mov     esi, [ebx+0Ch]
 .text:77D561AF                 add     esi, [ebp+arg_0]
 .text:77D561B2                 mov     edx, ecx
 .text:77D561B4                 shr     ecx, 2
 .text:77D561B7                 mov     edi, eax
 .text:77D561B9                 rep movsd
 .text:77D561BB                 mov     ecx, edx
 .text:77D561BD                 and     ecx, 3
 .text:77D561C0                 rep movsb
 
  More details and POC at http://www.xfocus.net/flashsky/icoExp/index.html
 
III.CREDIT: 
----------
 
Flashsky(fangxing@xxxxxxxxxxxxxxxx;flashsky@xxxxxxxxxx) discovery this
vuln:)
Vulnerability analysis and advisory by Flashsky and icbm.
Special thanks to "Fengshou" project members and all Venustech AD-Lab guys:P
 
V.DISCLAIMER:
------------
 
The information in this bulletin is provided "AS IS" without warranty of any
kind. In no event shall we be liable for any damages whatsoever including
direct,
indirect, incidental, consequential, loss of business profits or special
damages. 
 
Copyright 1996-2004 VENUSTECH. All Rights Reserved. Terms of use.
 
VENUSTECH Security Lab
VENUSTECH INFORMATION TECHNOLOGY CO.,LTD(http://www.venustech.com.cn)
 
          Security
Trusted  {Solution} Provider
          Service


------ End of Forwarded Message


-------------------------------------
You are subscribed as roessler@xxxxxxxxxxxxxxxxxx
To manage your subscription, go to
  http://v2.listbox.com/member/?listname=ip

Archives at: http://www.interesting-people.org/archives/interesting-people/