[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Windowsメタファイル SetPaletteエントリヒープオーバーフロー脆弱性



Windowsメタファイル SetPaletteエントリヒープオーバーフロー脆弱性
(画像描画エンジン脆弱性)

原版:
Windows Metafile SetPalette Entries Heap Overflow Vulnerability
(Graphics Rendering Engine Vulnerability)
http://www.eeye.com/html/research/advisories/AD20051108a.html

リリース日:
November 8, 2005

報告日: 
September 1, 2005

パッチ開発期間: 68日

リスクレベル: 
高 (コード実行)

ベンダ: 
Microsoft

対象システム:
Windows NT 4
Windows 2000
Windows XP SP0, SP1
Windows Server 2003 SP0

eEye ID#:  EEYEB-20050901
OSVDB ID#: 
CVE #:  CAN-2005-2123

概要:
eEye Digital Securityは、Windows Graphical Device Interface (GDI)の
Windowsメタファイル(.WMF)形式の画像ファイルの処理方法に脆弱性がある事を
発見しました。攻撃者はHTMLメール、ウェブページへのリンク、メタファイルを
含むMicrosoft Officeドキュメント、チャットメッセージなど、任意の手段にて
悪意のあるメタファイルを送信することで、ログインユーザの権限にて任意のコー
ドを実行させることが可能です。

詳細情報:
GDI32.DLLに含まれるWindowsメタファイル描画用コードの"SetPaletteEntries"
型レコードを処理する、PlayMetaFileRecord関数(36h及び37h)に整数オーバーフ
ロー脆弱性が存在します。レコード長が7FFFFFFFh又はFFFFFFFFhの場合、下記の
コードにて整数オーバーフローが発生します。レコード長フィールドの正当性チェッ
クが適切になされていないため、不十分なヒープブロックを割り当てさせること
が事が可能となります。

    77F5BC38    mov     eax, [ebx]         ; レコード長
    77F5BC3A    lea     eax, [eax+eax+2]   ; *** 整数オーバーフロー ***
    77F5BC3E    push    eax
    77F5BC3F    push    edi
    77F5BC40    call    ds:LocalAlloc
     ...
    77F5BC51    mov     ecx, [ebx]         ; レコード長
    77F5BC53    add     eax, 2
    77F5BC56    shl     ecx, 1             ; コピーサイズ != 割り当てサイズ
    77F5BC58    mov     edx, ecx           ; 内部 memcpy() 開始
    77F5BC5A    mov     esi, ebx
    77F5BC5C    mov     edi, eax
    77F5BC5E    shr     ecx, 2
    77F5BC61    rep movsd
    77F5BC63    mov     ecx, edx
    77F5BC65    and     ecx, 3
     ...
    77F5BC6D    rep movsb

コピー長も同様に整数オーバーフローの対象となりますが、メモリ割り当て長が"
レコード長(=コピー長)+2バイト"であるため、割り当てサイズを非常に小さく、
コピー長を非常に大きくする事が可能です。結果としてメタファイル中の任意の
バイナリデータで、完全にヒープを上書きする事が可能となります。

対応ソフトウェア情報:
Retina - ネットワーク脆弱性スキャナ
Blink - エンドポイント脆弱性保護

ベンダ対応状況:
Microsoft社は本脆弱性に対する対応パッチをリリースしました。
パッチは下記URLよりダウンロード可能です: 
http://www.microsoft.com/technet/security/bulletin/MS05-053.mspx

クレジット:
発見者: Fang Xing (eEye Digital Security)
翻訳: 高橋 晶子 (住商情報システム株式会社)

関連情報:
Retina Network Security Scanner - 評価版(日本語版)
 - https://sec.sse.co.jp/eeye/freedl.html
Blink Endpoint Vulnerability Prevention - 評価版(英語版)
 - http://www.eeye.com/html/products/blink/download/index.html


本Advisoryは、住商情報システム株式会社(SCS)が、eEye Digital Securityの
許可を得た上で翻訳しております。
SCSは本和訳が正確な情報になるよう努めさせて頂きます。しかしながら、正確
性、完全性、信頼性、安全性等に関して、いかなる責任も負わないことと致しま
す。


Copyright (c) 1998-2005 eEye Digital Security
Permission is hereby granted for the redistribution of this alert
electronically. It is not to be edited in any way without express
consent of eEye.  If you wish to reprint the whole or any part of this
alert in any other medium excluding electronic medium, please email
alert@xxxxxxxx for permission.

Disclaimer
The information within this paper may change without notice. Use of this
information constitutes acceptance for use in an AS IS condition.  There
are no warranties, implied or express, with regard to this information.
In no event shall the author be liable for any direct or indirect
damages whatsoever arising out of or in connection with the use or
spread of this information.  Any use of this information is at the
user's own risk.


----------------------------------------
  高橋 晶子 <takahashi.akiko@xxxxxxxxx>
  住商情報システム株式会社
  セキュリティソリューション事業部
  セキュリティソリューション第4部
  〒104-8610 東京都中央区晴海1-8-12