CVE-2016-7290: 微软office word的整数下溢漏洞分析

安全 漏洞
这个下溢是当word处理特殊的二进制文档文件时,在复制操作期间越界读取时触发,能够导致winword.exe保护模式下栈的缓冲区溢出问题。一切听起来是戏剧性的,但是PoC触发只需要越界读取,然而本文将深入分析漏洞细节。

[[182250]]

一、前言

这个下溢是当word处理特殊的二进制文档文件时,在复制操作期间越界读取时触发,能够导致winword.exe保护模式下栈的缓冲区溢出问题。

一切听起来是戏剧性的,但是PoC触发只需要越界读取,然而本文将深入分析漏洞细节。

这个漏洞影响Microsoft Word 2007 Service Pack 3, Microsoft Office 2010 Service Pack 2 (32位版本), Microsoft Office 2010 Service Pack 2 (64位版本) 和 Microsoft Office Compatibility Pack Service Pack 3。更多的细节能从SRC-2016-0042获取。本文所有的分析是基于Microsoft Office 2010 专业版的winword.exe(v14.0.4734.1000)。

首先,来看下sample和PoC文件的不同之处。

sample和PoC文件的不同

注意到只有一个字节的不同。接下来看下哪个结构块包含了这个不同。

sample和PoC文件的不同之处

可以看到不同之处在于OneTableDocumentStream数据域中。Sample文件的值为0x68,而poc文件使用0xfa来触发下溢。

 

二、触发漏洞

 

首先,为了调试开启页堆和用户态栈跟踪:

  1. c:\Program Files\Debugging Tools for Windows (x86)>gflags.exe -i winword.exe +hpa +ust 
  2. Current Registry Settings for winword.exe executable are: 02001000 
  3.     ust - Create user mode stack trace database 
  4.     hpa - Enable page heap 
  5. c:\Program Files\Debugging Tools for Windows (x86)> 

然后运行poc.doc文件导致以下保护模式外异常访问:

  1. (880.ac4): Access violation - code c0000005 (first chance) 
  2. First chance exceptions are reported before any exception handling. 
  3. This exception may be expected and handled. 
  4. eax=00000000 ebx=00000000 ecx=00000033 edx=00000002 esi=22870ffd edi=002513c4 
  5. eip=744fb40c esp=0024c694 ebp=0024c69c iopl=0         nv up ei pl nz ac po nc 
  6. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  7. MSVCR90!memmove+0xfc: 
  8. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 
  9. 0:000> kvn 
  10.  # ChildEBP RetAddr  Args to Child               
  11. 00 0024c69c 5e3f9b36 002513bf 22870ff8 000000d3 MSVCR90!memmove+0xfc 
  12. WARNING: Stack unwind information not available. Following frames may be wrong. 
  13. 01 0024c6b0 5e413843 22870ff8 002513bf 000000d3 wwlib!DllGetClassObject+0x455a 
  14. 02 0024c744 5e413223 002513ac 002513a0 00004ab8 wwlib!GetAllocCounters+0xcadb 
  15. 03 00251230 5e4131c6 002513ac 002513a0 00004ab8 wwlib!GetAllocCounters+0xc4bb 
  16. 04 00251264 5e45f414 002513ac 002513a0 00004ab8 wwlib!GetAllocCounters+0xc45e 
  17. 05 00251280 5e8da8a7 002513a0 22872fe4 00000000 wwlib!GetAllocCounters+0x586ac 
  18. 06 002512b8 5e89fdcb 04760520 002513a0 ffffffff wwlib!DllGetLCID+0x2d4521 
  19. 07 002567f4 5e66e957 1b132948 04760098 00000000 wwlib!DllGetLCID+0x299a45 
  20. 08 002580e0 5e671d5b 04760098 00258928 00000001 wwlib!DllGetLCID+0x685d1 
  21. 09 00258584 5e671489 04760098 00258928 1b132948 wwlib!DllGetLCID+0x6b9d5 
  22. 0a 0025894c 5e675c10 04760098 00002490 00000000 wwlib!DllGetLCID+0x6b103 
  23. 0b 00258998 5e4a6ad4 04760098 1b132948 0000056e wwlib!DllGetLCID+0x6f88a 
  24. 0c 002589d4 64270be6 22562f10 0000056e 00000000 wwlib!GetAllocCounters+0x9fd6c 
  25. 0d 002589f8 64270ebd 18bea880 18bea998 00258aa8 MSPTLS!FsTransformBbox+0x279b3 
  26. 0e 00258a4c 64270f2c 22798de8 00258d40 00000000 MSPTLS!FsTransformBbox+0x27c8a 
  27. 0f 00258aec 64271196 00258d40 00000000 00000000 MSPTLS!FsTransformBbox+0x27cf9 
  28. 10 00258ca0 6425736a 22798de8 227f0ca0 00000000 MSPTLS!FsTransformBbox+0x27f63 
  29. 11 00258db4 6428aa6f 22826fd0 00000000 00000000 MSPTLS!FsTransformBbox+0xe137 
  30. 12 00258eac 6426fbb9 22798de8 227f0ca0 00000000 MSPTLS!FsTransformBbox+0x4183c 
  31. 13 00259000 6425684e 22798de8 00000000 00000000 MSPTLS!FsTransformBbox+0x26986 

三、调查访问的内存

 

第一步我们要检查在崩溃时访问的内存。

  1.     address 22870ffd found in 
  2.     _DPH_HEAP_ROOT @ 61000 
  3.     in busy allocation (  DPH_HEAP_BLOCK:         UserAddr         UserSize -         VirtAddr         VirtSize) 
  4.                                 227a13a8:         22870fe0               19 -         22870000             2000 
  5.     67be8e89 verifier!AVrfDebugPageHeapAllocate+0x00000229 
  6.     77126206 ntdll!RtlDebugAllocateHeap+0x00000030 
  7.     770ea127 ntdll!RtlpAllocateHeap+0x000000c4 
  8.     770b5950 ntdll!RtlAllocateHeap+0x0000023a 
  9.     5de2d804 mso!Ordinal149+0x000074b0 
  10.     5e6a754d wwlib!DllGetLCID+0x000a11c7 
  11.     5e7debc2 wwlib!DllGetLCID+0x001d883c 
  12.     5e41f313 wwlib!GetAllocCounters+0x000185ab 
  13.     5e41ec32 wwlib!GetAllocCounters+0x00017eca 
  14.     5e41eb57 wwlib!GetAllocCounters+0x00017def 
  15.     5e41e72a wwlib!GetAllocCounters+0x000179c2 
  16.     5e423d89 wwlib!GetAllocCounters+0x0001d021 
  17.     5e6acca5 wwlib!DllGetLCID+0x000a691f 
  18.     5e422aa0 wwlib!GetAllocCounters+0x0001bd38 
  19.     5e43ed59 wwlib!GetAllocCounters+0x00037ff1 
  20.     5e43ec61 wwlib!GetAllocCounters+0x00037ef9 
  21.     5e48f0c3 wwlib!GetAllocCounters+0x0008835b 
  22.     5e48f050 wwlib!GetAllocCounters+0x000882e8 
  23.     5e4a6aba wwlib!GetAllocCounters+0x0009fd52 
  24.     64270be6 MSPTLS!FsTransformBbox+0x000279b3 
  25.     64270ebd MSPTLS!FsTransformBbox+0x00027c8a 
  26.     64270f2c MSPTLS!FsTransformBbox+0x00027cf9 
  27.     64271196 MSPTLS!FsTransformBbox+0x00027f63 
  28.     6425736a MSPTLS!FsTransformBbox+0x0000e137 
  29.     6428aa6f MSPTLS!FsTransformBbox+0x0004183c 
  30.     6426fbb9 MSPTLS!FsTransformBbox+0x00026986 
  31.     6425684e MSPTLS!FsTransformBbox+0x0000d61b 
  32.     6426ad48 MSPTLS!FsTransformBbox+0x00021b15 
  33.     6428573e MSPTLS!FsTransformBbox+0x0003c50b 
  34.     64285910 MSPTLS!FsTransformBbox+0x0003c6dd 
  35.     64285c7b MSPTLS!FsTransformBbox+0x0003ca48 
  36.     6426b17a MSPTLS!FsTransformBbox+0x00021f47 
  37. 0:000> !address @edi 
  38.  ProcessParametrs 00069738 in range 00069000 0006a000 
  39.  Environment 02b233d8 in range 02b23000 02b24000 
  40.     00160000 : 0023d000 - 00023000 
  41.                     Type     00020000 MEM_PRIVATE 
  42.                     Protect  00000004 PAGE_READWRITE 
  43.                     State    00001000 MEM_COMMIT 
  44.                     Usage    RegionUsageStack 
  45.                     Pid.Tid  880.ac4     
  46. 0:000> dd @esi 
  47. 22870ffd  ???????? ???????? ???????? ???????? 
  48. 2287100d  ???????? ???????? ???????? ???????? 
  49. 2287101d  ???????? ???????? ???????? ???????? 
  50. 2287102d  ???????? ???????? ???????? ???????? 
  51. 2287103d  ???????? ???????? ???????? ???????? 
  52. 2287104d  ???????? ???????? ???????? ???????? 
  53. 2287105d  ???????? ???????? ???????? ???????? 
  54. 2287106d  ???????? ???????? ???????? ???????? 
  55. 0:000> ?@ecx*4 
  56. Evaluate expression: 204 = 000000cc 

可以看到越界读取了一个0x19字节的堆内存,试着将另外的204个字节复制到edi中。

正如结果,栈变量在顶上6个栈桢传递,下面的是通过其他变量和偏移动态计算的。没有符号直接加大了跟踪的难度。

四、写内存

 

如果我们继续从esi读,那么可以假定继续写是安全的。我知道这是一个大的猜测,但是利用ole堆喷射或者得到使用eps的的堆,是有可能控制那个偏移的数据的。但是如何覆写?我们看下目标栈地址:

  1. 0:000> !py mona do -a 002513c4 -s 0xcc 
  2. Hold on... 
  3. [+] Command used: 
  4. !py mona.py do -a 002513c4 -s 0xcc 
  5. ---------------------------------------------------- 
  6. [+] Dumping object at 0x002513c4, 0xcc bytes 
  7. [+] Preparing output file 'dumpobj.txt' 
  8.     - (Re)setting logfile dumpobj.txt 
  9. [+] Generating module info table, hang on... 
  10.     - Processing modules 
  11.     - Done. Let's rock 'n roll. 
  12. >> Object at 0x002513c4 (0xcc bytes): 
  13. Offset  Address      Contents    Info 
  14. ------  -------      --------    ----- 
  15. +00     0x002513c4 | 0x00000000   
  16. +04     0x002513c8 | 0x000bd62f   
  17. +08     0x002513cc | 0x00002001   
  18. +0c     0x002513d0 | 0x0000ff00   
  19. +10     0x002513d4 | 0xd63b0000   
  20. +14     0x002513d8 | 0x8001000c   
  21. +18     0x002513dc | 0xff000000   
  22. +1c     0x002513e0 | 0x0100ffff   
  23. +20     0x002513e4 | 0x00000000   
  24. +24     0x002513e8 | 0x00000000   
  25. +28     0x002513ec | 0xffffffff   
  26. +2c     0x002513f0 | 0x00000000   
  27. +30     0x002513f4 | 0x00000000   
  28. +34     0x002513f8 | 0x00000000   
  29. +38     0x002513fc | 0x00000000   
  30. +3c     0x00251400 | 0x00000000   
  31. +40     0x00251404 | 0xff000000   
  32. +44     0x00251408 | 0x00000000   
  33. +48     0x0025140c | 0xff000000   
  34. +4c     0x00251410 | 0x00000000   
  35. +50     0x00251414 | 0xff000000   
  36. +54     0x00251418 | 0x00000c48   
  37. +58     0x0025141c | 0xffffffff   
  38. +5c     0x00251420 | 0x00000000   
  39. +60     0x00251424 | 0xff000000   
  40. +64     0x00251428 | 0x00000000   
  41. +68     0x0025142c | 0xff000000   
  42. +6c     0x00251430 | 0x00000000   
  43. +70     0x00251434 | 0x1b132948  ptr to 0x5e52ee80 : wwlib!GetAllocCounters+0x128118 
  44. +74     0x00251438 | 0xff000000   
  45. +78     0x0025143c | 0x00000000   
  46. +7c     0x00251440 | 0x00000000   
  47. +80     0x00251444 | 0x00000000   
  48. +84     0x00251448 | 0x00000000   
  49. +88     0x0025144c | 0x00000000   
  50. +8c     0x00251450 | 0xff000000   
  51. +90     0x00251454 | 0x00000000   
  52. +94     0x00251458 | 0x00000000   
  53. +98     0x0025145c | 0x00000000   
  54. +9c     0x00251460 | 0x00000000   
  55. +a0     0x00251464 | 0x00000000   
  56. +a4     0x00251468 | 0x00000000   
  57. +a8     0x0025146c | 0x00000000   
  58. +ac     0x00251470 | 0x00000000   
  59. +b0     0x00251474 | 0x00000000   
  60. +b4     0x00251478 | 0x00000000   
  61. +b8     0x0025147c | 0x00000000   
  62. +bc     0x00251480 | 0x00000000   
  63. +c0     0x00251484 | 0x00000000   
  64. +c4     0x00251488 | 0x00000000   
  65. +c8     0x0025148c | 0x00000000 

使用mona插件,能够将拷贝剩余大小的栈地址转储,可以看见有个指针指向.text (wwlib!GetAllocCounters+0x128118)。如果没猜错,我们不应该覆写这个值。

 

因此,我们可能溢出了一个栈缓冲区(可能性不大)。如果我们想命中返回地址,需要知道目的地址+0x1e8处才能出现。好奇之下能够定位到这里:

  1. ... 
  2. +cc     0x00251490 | 0xff700000   
  3. +d0     0x00251494 | 0x00ffffff   
  4. +d4     0x00251498 | 0x00000000   
  5. +d8     0x0025149c | 0x00000000   
  6. ...  
  7. +1dc    0x002515a0 | 0x1b132be0   
  8. +1e0    0x002515a4 | 0x0000005e   
  9. +1e4    0x002515a8 | 0x002515c4  ptr to self+0x00000200 
  10. +1e8    0x002515ac | 0x5e415bc1  wwlib!GetAllocCounters+0xee59 
  11. [+] This mona.py action took 0:00:01.669000 
  12. 0:000> ub 0x5e415bc1   
  13. wwlib!GetAllocCounters+0xee41: 
  14. 5e415ba9 5e              pop     esi 
  15. 5e415baa 81fbffffff7f    cmp     ebx,7FFFFFFFh 
  16. 5e415bb0 0f873e393c00    ja      wwlib!DllGetLCID+0x1d316e (5e7d94f4) 
  17. 5e415bb6 8b5508          mov     edx,dword ptr [ebp+8] 
  18. 5e415bb9 53              push    ebx 
  19. 5e415bba 50              push    eax 
  20. 5e415bbb 52              push    edx 
  21. 5e415bbc e8b9e9fdff      call    wwlib+0x457a (5e3f457a) 

我们无法看见调用栈,因为栈向上伸展失败了:

  1. 0:000> ?0x002515ac-@esp 
  2.  
  3. Evaluate expression: 20248 = 00004f18 

接下来的问题是,怎么模拟继续执行?

 

Bannedit编写了一个很好的插件counterfeit,可以在windbg中看到用VirtualAlloc分配的块并且用标记的数据填充它。我们能继续并替换esi的值,继续复制操作。

  1. 0:000> !py cf -a 2000 -f 
  2.                            __                 _____      .__  __    
  3.   ____  ____  __ __  _____/  |_  ____________/ ____\____ |__|/  |_  
  4. _/ ___\/  _ \|  |  \/    \   __\/ __ \_  __ \   __\/ __ \|  \   __\ 
  5. \  \__(  <_> )  |  /   |  \  | \  ___/|  | \/|  | \  ___/|  ||  |   
  6.  \___  >____/|____/|___|  /__|  \___  >__|   |__|  \___  >__||__|   
  7.      \/                 \/          \/                 \/ 
  8.             version 1.0 - bannedit 
  9. Allocated memory @ 0x14130000 with RWX permissions. 
  10. Filling memory... 
  11. Finished filling memory. 
  12. 0:000> dd 0x14130000 
  13. 14130000  41414141 41414142 41414143 41414144 
  14. 14130010  41414145 41414146 41414147 41414148 
  15. 14130020  41414149 4141414a 4141414b 4141414c 
  16. 14130030  4141414d 4141414e 4141414f 41414150 
  17. 14130040  41414151 41414152 41414153 41414154 
  18. 14130050  41414155 41414156 41414157 41414158 
  19. 14130060  41414159 4141415a 4141415b 4141415c 
  20. 14130070  4141415d 4141415e 4141415f 41414160 

现在我们看到esi位于0x14130000:

  1. 0:000> g 
  2. (880.ac4): Access violation - code c0000005 (!!! second chance !!!) 
  3. eax=00000000 ebx=00000000 ecx=00000033 edx=00000002 esi=22870ffd edi=002513c4 
  4. eip=744fb40c esp=0024c694 ebp=0024c69c iopl=0         nv up ei pl nz ac po nc 
  5. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  6. MSVCR90!memmove+0xfc: 
  7. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 
  8. 0:000> r @esi=0x14130000 
  9. ... 
  10. 0:000> t 
  11. eax=00000000 ebx=00000000 ecx=00000017 edx=00000002 esi=14130070 edi=00251434 
  12. eip=744fb40c esp=0024c694 ebp=0024c69c iopl=0         nv up ei pl nz ac po nc 
  13. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  14. MSVCR90!memmove+0xfc: 
  15. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 
  16. 0:000> dd @edi L1 
  17. 00251434  1b132948 
  18. 0:000> dds poi(@edi) L1 
  19. 1b132948  5e52ee80 wwlib!GetAllocCounters+0x128118 
  20. 0:000> u poi(poi(@edi)) 
  21. wwlib!GetAllocCounters+0x6e3b0: 
  22. 5e475118 55              push    ebp 
  23. 5e475119 8bec            mov     ebp,esp 
  24. 5e47511b 56              push    esi 
  25. 5e47511c 8bf1            mov     esi,ecx 
  26. 5e47511e e814000000      call    wwlib!GetAllocCounters+0x6e3cf (5e475137) 
  27. 5e475123 f6450801        test    byte ptr [ebp+8],1 
  28. 5e475127 7407            je      wwlib!GetAllocCounters+0x6e3c8 (5e475130) 
  29. 5e475129 56              push    esi 
  30. 0:000> t 
  31. eax=00000000 ebx=00000000 ecx=00000016 edx=00000002 esi=14130074 edi=00251438 
  32. eip=744fb40c esp=0024c694 ebp=0024c69c iopl=0         nv up ei pl nz ac po nc 
  33. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  34. MSVCR90!memmove+0xfc: 
  35. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 
  36. 0:000> dds poi(@edi-4) L1 
  37. 4141415d  ???????? 

我们能看到我们覆写数据的指针,指向了来自esi中值对应的函数。因为esi中的数据是标记过的,我们能知道用来覆写指针的偏移。

五、曝光

 

再次观察调用栈,注意到memmove()的调用。

  1. 0:000> kvn L2 
  2.  # ChildEBP RetAddr  Args to Child               
  3. 00 0024c69c 5e3f9b36 002513bf 22870ff8 000000d3 MSVCR90!memmove+0xfc 
  4. WARNING: Stack unwind information not available. Following frames may be wrong. 
  5. 01 0024c6b0 5e413843 22870ff8 002513bf 000000d3 wwlib!DllGetClassObject+0x455a 

用Hex-Rays反编译器,可以看到这个函数只是memmove()的一个封装,并在wwlib库中调用。可以重命名sub_316d9b16函数为memmove_wrapper_1。

  1. int __stdcall memmove_wrapper_1(void *Src, void *Dst, size_t Size) 
  2.   int result; // eax@2 
  3.   if ( Size > 0x7FFFFFFF ) 
  4.     result = MSO_1511(1647603307, 0); 
  5.   else 
  6.     result = (int)memmove(Dst, Src, Size); 
  7.   return result; 

如果大小大于MAX_INT,一个整形溢出异常被触发。另外也没有合理的校验小雨目的缓冲区的情况。

为了利用,我们得知道memmove()如何访问和被调用。

 

所以设置一个断点bp wwlib!DllGetClassObject+0x4554 ".printf \"calling memmove(%x, %x, %x);\\n\", poi(@esp), poi(@esp+4), poi(@esp+8); gc"并重新运行PoC。

  1. calling memmove(271164, 26fb3c, e); 
  2. calling memmove(271172, 26fb4a, f); 
  3. calling memmove(271148, 2266efe0, 3); 
  4. calling memmove(27114b, 2266efe3, 3); 
  5. calling memmove(27114e, 2266efe6, 3); 
  6. calling memmove(271151, 2266efe9, 3); 
  7. calling memmove(271154, 2266efec, 3); 
  8. calling memmove(271157, 2266efef, 4); 
  9. calling memmove(27115b, 2266eff3, 5); 
  10. calling memmove(27122e, 27115b, 5); 
  11. calling memmove(27115b, 2266eff8, d3); 
  12. (5f0.59c): Access violation - code c0000005 (first chance) 
  13. First chance exceptions are reported before any exception handling. 
  14. This exception may be expected and handled. 
  15. eax=00000000 ebx=00000000 ecx=00000033 edx=00000002 esi=2266effd edi=00271160 
  16. eip=744fb40c esp=0026c430 ebp=0026c438 iopl=0         nv up ei pl nz ac po nc 
  17. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  18. MSVCR90!memmove+0xfc: 
  19. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 

有一系列的源缓冲区是0x2266efXX开头的,并且目的缓冲区是0x002711YY。怀疑这是在一个错误的循环中多次调用memmove()。

 

我决定分析每个调用来判断是否是独特的。在windbg中执行‘k’命令不能继续分割它,我们已经准备在上述断点减缓执行。我决定用一个轻量的windbg插件来收集返回地址:

  1. from pykd import * 
  2. mashed = 0 
  3. for frame in getStack(): 
  4.     mashed += frame.returnOffset 
  5. print "stack hash: 0x%x" % mashed 
  1. 0:000> !py sh 
  2. stack hash: 0x199a6804c9 

现在将它添加到我们的断点,换一行并在末尾增加空格,最后重新运行:

  1. 0:010> bu wwlib!DllGetClassObject+0x4554 ".printf \"calling memmove(%x, %x, %x); \", poi(@esp), poi(@esp+4), poi(@esp+8); !py sh; gc" 
  2. 0:010> g 
  3. ... 
  4. calling memmove(190fa4, 18f97c, e); stack hash: 0x18a96a3a98 
  5. calling memmove(190fb2, 18f98a, f); stack hash: 0x18a96a3a98 
  6. calling memmove(190f88, 49d7fe0, 3); stack hash: 0x1847ab6993 
  7. calling memmove(190f8b, 49d7fe3, 3); stack hash: 0x1847ab6993 
  8. calling memmove(190f8e, 49d7fe6, 3); stack hash: 0x1847ab6993 
  9. calling memmove(190f91, 49d7fe9, 3); stack hash: 0x1847ab6993 
  10. calling memmove(190f94, 49d7fec, 3); stack hash: 0x1847ab6993 
  11. calling memmove(190f97, 49d7fef, 4); stack hash: 0x1847ab6993 
  12. calling memmove(190f9b, 49d7ff3, 5); stack hash: 0x1847ab6993 
  13. calling memmove(19106e, 190f9b, 5); stack hash: 0x1847ad8b4c 
  14. calling memmove(190f9b, 49d7ff8, d3); stack hash: 0x1847ab6993 
  15. (7dc.71c): Access violation - code c0000005 (first chance) 
  16. First chance exceptions are reported before any exception handling. 
  17. This exception may be expected and handled. 
  18. eax=00000000 ebx=00000000 ecx=00000033 edx=00000002 esi=049d7ffd edi=00190fa0 
  19. eip=744fb40c esp=0018c270 ebp=0018c278 iopl=0         nv up ei pl nz ac po nc 
  20. cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00210212 
  21. MSVCR90!memmove+0xfc: 
  22. 744fb40c f3a5            rep movs dword ptr es:[edi],dword ptr [esi] 

现在可以判断memmove() 在一个循环中被调用,因为在同一个栈哈希值0x1847ab6993。

六、影响

因为不能溢出返回地址和之后在写或复制操作中会访问和用到的一些值,这个漏洞的影响非常小。

Microsoft将此漏洞修补为“Microsoft Office信息泄露漏洞”,这在本文中介绍的上下文中说的通。然而,如果我们能够在溢出覆盖栈中.text中的一个指针,这个漏洞将影响更大。

在sub_316f3232函数中,有525处调用memmove_wrapper_1(),意味着有有多种途径可以触发这个漏洞。

另外在栈中没有一个函数使用了/GS保护,意味着如果返回地址被覆盖,没有系统级别的缓解措施能够缓解它。

七、总结

 

许多复杂的漏洞在office代码中一直存在,只是难以被发现。甚至更难去调查根因并开发利用,如果微软开放了符号表,将能更好的发现漏洞。

责任编辑:赵宁宁 来源: 安全客
相关推荐

2021-09-23 15:20:18

微软漏洞代码

2020-10-25 09:39:49

漏洞分析

2022-06-14 09:00:21

漏洞补丁

2016-01-27 14:30:20

2021-10-26 11:47:22

微软office漏洞黑客

2016-03-21 14:47:45

微软桌面版Office 2

2021-06-15 10:58:17

微软officeMSGraph安全漏洞

2015-03-13 18:08:49

2016-10-18 14:22:41

2017-05-25 22:20:05

2020-10-09 08:00:00

漏洞

2013-11-29 11:01:44

2023-12-08 09:00:00

漏洞攻击

2015-09-18 09:33:03

2013-01-10 16:12:02

Ruby on Rai漏洞

2013-11-06 15:09:27

2015-08-14 13:53:24

2021-09-09 06:32:28

零日漏洞网络攻击微软

2021-12-11 10:27:53

Windows 11操作系统微软

2021-07-04 10:25:14

漏洞网络安全网络攻击
点赞
收藏

51CTO技术栈公众号