微软MS09-002漏洞分析报告

安全 黑客攻防
Internet Explorer的CFunctionPointer函数没有正确处理文档对象,如果以特定序列附加并删除了对象,就可以触发内存破坏。攻击者可以构造特殊顺序的代码触发这个内存破坏,同时利用精心构造的缓冲区,导致以当前登录用户的权限执行任意代码。

Internet Explorer的CFunctionPointer函数没有正确处理文档对象,如果以特定序列附加并删除了对象,就可以触发内存破坏。攻击者可以构造特殊顺序的代码触发这个内存破坏,同时利用精心构造的缓冲区,导致以当前登录用户的权限执行任意代码。

该弱点实际存在于mshtml.dll中。CFunctionPointer对象在其构造函数中没有正确地引用文档对象(标签对象或其它),导致该文档对象可能在CFunctionPointer对象释放前被释放,而CFunctionPointer会继续使用这个已经被销毁的文档对象。

这是CFunctionPointer的构造函数:
public: __thiscall CFunctionPointer::CFunctionPointer(class CBase *, long)
.text:775E7BE9                 mov     edi, edi
.text:775E7BEB                 push    ebp
.text:775E7BEC                 mov     ebp, esp
.text:775E7BEE                 push    esi
.text:775E7BEF                 mov     esi, ecx
.text:775E7BF1                 call    ??0CBase@@QAE@XZ ; CBase::CBase(void)
.text:775E7BF6                 mov     ecx, [ebp+pOwner]
.text:775E7BF9                 test    ecx, ecx
.text:775E7BFB                 mov     eax, [ebp+pISecurityContext]
.text:775E7BFE                 mov     dword ptr [esi], offset ??_7CFunctionPointer@@6B@ ; const CFunctionPointer::`vftable'
.text:775E7C04                 mov     [esi+10h], ecx // 设置关联文档对象

在设置文档对象时,CFunctionPointer的构造函数仅仅是简单的将其赋给[edi+10h],而没有对其进行引用(AddRef)。

而在CFunctionPointer其他函数中几乎都使用了该关联文档对象指针,例如实现IUnknown::AddRef的CFunctionPointer::PrivateAddRef,实现IUnknown::Release的CFunctionPointer::PrivateRelease。

这是CFunctionPointer::PrivateAddRef函数:
virtual unsigned long CFunctionPointer::PrivateAddRef(void)
.text:775E7A21 arg_0           = dword ptr  8
.text:775E7A21                 mov     edi, edi
.text:775E7A23                 push    ebp
.text:775E7A24                 mov     ebp, esp
.text:775E7A26                 push    esi
.text:775E7A27                 mov     esi, [ebp+arg_0] ; this
.text:775E7A2A                 mov     eax, [esi+10h] ;获得文档对象指针
.text:775E7A2D                 test    eax, eax
.text:775E7A2F                 jz      short loc_775E7A3D
.text:775E7A31                 cmp     dword ptr [esi+4], 0
.text:775E7A35                 jz      short loc_775E7A3D
.text:775E7A37                 mov     ecx, [eax] ;取第一个DWORD,即虚表指针
.text:775E7A39                 push    eax
.text:775E7A3A                call    dword ptr [ecx+4] ;调用+4位置给出的函数,即AddRef

例如在CFunctionPointer::PrivateAddRef中,如果文档对象已经被销毁,那么将获得不可预知的虚表指针,接下来执行call dword ptr [ecx+4]后,将跳转到一个不可预知地址去执行 ,在一般情况下会导致IE崩溃。

攻击者可以以特定的步骤,使CFunctionPointer对象的关联文档对象在CFunctio nPointer对象释放前被释放,接着再引用该CFunctionPointer对象,致使已经被释放的文档对象被重新使用。

而攻击者又可以以特殊的方式,任意设置被释放文档对象原来所在内存位置的数据(即可构造不正确的虚表),导致该弱点被扩大到可以被利用于执行任意代码。

 

责任编辑:王文文 来源: 51CTO.com
相关推荐

2009-02-19 15:29:19

2010-09-15 09:24:55

2009-10-20 09:58:38

2015-03-11 16:23:01

2013-03-22 10:00:14

2015-12-03 15:53:57

2013-12-11 14:51:06

2009-09-10 09:24:47

2011-04-21 15:40:52

微软漏洞报告

2011-08-26 11:44:01

2021-12-07 23:11:15

漏洞微软谷歌

2022-08-24 08:22:39

漏洞网络攻击微软

2014-10-16 10:17:01

2017-10-18 15:41:54

2021-06-18 06:21:02

微软漏洞报告BeyondTrust

2018-09-19 12:53:52

微软数据中心故障

2013-10-09 09:27:58

2010-03-12 14:07:59

2015-12-15 16:51:48

2015-11-11 11:37:23

点赞
收藏

51CTO技术栈公众号