Vulnerabilities > CVE-2008-0986 - Numeric Errors vulnerability in Google Android SDK M5Rc14

047910
CVSS 7.5 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
PARTIAL
Availability impact
PARTIAL
network
low complexity
google
CWE-189
exploit available

Summary

Integer overflow in the BMP::readFromStream method in the libsgl.so library in Google Android SDK m3-rc37a and earlier, and m5-rc14, allows remote attackers to execute arbitrary code via a crafted BMP file with a header containing a negative offset field.

Vulnerable Configurations

Part Description Count
Application
Google
2

Common Weakness Enumeration (CWE)

Exploit-Db

descriptionAndroid Web Browser BMP File Integer Overflow Vulnerability. CVE-2008-0986. Dos exploit for android platform
idEDB-ID:31308
last seen2016-02-03
modified2008-03-04
published2008-03-04
reporterAlfredo Ortega
sourcehttps://www.exploit-db.com/download/31308/
titleAndroid Web Browser - BMP File Integer Overflow Vulnerability

Packetstorm

data sourcehttps://packetstormsecurity.com/files/download/64260/CORE-2008-0124.txt
idPACKETSTORM:64260
last seen2016-12-05
published2008-03-04
reporterCore Security Technologies
sourcehttps://packetstormsecurity.com/files/64260/Core-Security-Technologies-Advisory-2008.0124.html
titleCore Security Technologies Advisory 2008.0124

Seebug

bulletinFamilyexploit
descriptionBUGTRAQ ID: 28006 CVE(CAN) ID: CVE-2008-0986 Android是Google通过Open Handset Alliance发起的项目,用于为移动设备提供完整的软件集,包括操作系统、中间件等。 Android SDK的libsgl.so库中的BMP::readFromStream(Stream *, ImageDecoder::Mode)方式在解析BMP图形文件头时存在整数溢出漏洞,远程攻击者可能利用此漏洞控制用户设备。 如果BMP文件头的offset字段值为负数且Bitmap Information部分(DIB头)指定了8 bpp的图形的话,解析器就会尝试分配画板并使用了该负数偏移来计算画板的大小。 以下代码使用白颜色(0x00ffffff)初始化画板,但如果选择了特制的负数偏移,就可以使用该值覆盖进程的任意地址。以下是Android中所捆绑的二进制程序的反汇编: /----------- .text:0002EE38 MOV LR, R7 ; R7 is the negative offset .text:0002EE3C MOV R12, R7,LSL#2 .text:0002EE40 .text:0002EE40 loc_2EE40 .text:0002EE40 LDR R3, [R10,#0x10] .text:0002EE44 ADD LR, LR, #1 .text:0002EE48 MOVL R2, 0xFFFFFFFF .text:0002EE4C ADD R1, R12, R3 ; R3 is uninitialized (because of the same bug) but ranges 0x10000-0x20000 .text:0002EE50 MOV R0, #0 .text:0002EE54 CMP LR, R9 .text:0002EE58 STRB R2, [R12,R3] ;Write 0x00ffffff to R12+13 (equals R1) .text:0002EE5C STRB R2, [R1,#2] .text:0002EE60 STRB R0, [R1,#3] .text:0002EE64 STRB R2, [R1,#1] .text:0002EE68 ADD R12, R12, #4 .text:0002EE6C BNE loc_2EE40 - -----------/ 以下是Android浏览器中的内存映射: /----------- # ps ps USER PID PPID VSIZE RSS WCHAN PC NAME root 1 0 248 64 c0084edc 0000ae2c S /init root 2 0 0 0 c0049168 00000000 S kthreadd ... root 1206 1165 16892 14564 c0084edc 00274af8 S ./gdb app_0 1574 535 83564 12832 ffffffff afe0c79c S com.google.android.browser root 1600 587 840 324 00000000 afe0bfbc R ps # cat /proc/1574/maps cat /proc/1574/maps 00008000-0000a000 rwxp 00000000 1f:00 514 /system/bin/app_process 0000a000-00c73000 rwxp 0000a000 00:00 0 [heap] 08000000-08001000 rw-s 00000000 00:08 344 /dev/zero (deleted) ... # - -----------/ 可见堆范围为0000a000-00c73000且可执行,如果堆中存储了虚表的话覆盖这个区域就会允许重新定向执行流。之后以同样的方式对Stream对象虚表执行了调用: /----------- .text:0002EB64 LDR R12, [R8] # R8 is the &quot;this&quot; pointer of the Stream Object .text:0002EB68 MOV R0, R8 .text:0002EB6C MOV LR, PC .text:0002EB70 LDR PC, [R12,#0x10] # A call is made to Stream+0x10 - -----------/ 由于Stream对象(R8)存储在堆上,因此可以用白色0x00ffffff填充堆,以0xffffff+0x10值上传程序计数器。 Google Android SDK m5-rc14 Google Android SDK m3-rc37a 厂商补丁: Google ------ 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href=http://android-developers.blogspot.com/2008/03/android-sdk-update-m5-rc15-released.html target=_blank>http://android-developers.blogspot.com/2008/03/android-sdk-update-m5-rc15-released.html</a>
idSSV:2983
last seen2017-11-19
modified2008-03-06
published2008-03-06
reporterRoot
sourcehttps://www.seebug.org/vuldb/ssvid-2983
titleAndroid软件开发工具包BMP文件处理整数溢出漏洞