Nytro Posted December 1, 2014 Report Posted December 1, 2014 Microsoft Office 2007 TTDeleteEmbeddedFont handle double deleteThe following access violation was observed in Microsoft Office 2007:(7a4.808): Access violation - code c0000005 (first chance)First chance exceptions are reported before any exception handling.This exception may be expected and handled.eax=00000001 ebx=feeefeee ecx=7ffdf000 edx=00150608 esi=00150000 edi=feeefee6eip=7c87c9e1 esp=0012f244 ebp=0012f298 iopl=0 nv up ei pl zr na po nccs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00010246ntdll!RtlDebugFreeHeap+0x82:7c87c9e1 0fb707 movzx eax,word ptr [edi] ds:0023:feeefee6=????0:000> kChildEBP RetAddr0012f298 7c85567a ntdll!RtlDebugFreeHeap+0x820012f370 7c83e448 ntdll!RtlFreeHeapSlowly+0x370012f454 73c37fb4 ntdll!RtlFreeHeap+0x11a0012f468 73c34a77 T2EMBED!T2free+0x1d0012f86c 31dbbb54 T2EMBED!TTDeleteEmbeddedFont+0x7c0012f884 31dbbae9 wwlib!DllCanUnloadNow+0x25fbcb0012f8ec 313406d8 wwlib!DllCanUnloadNow+0x25fb600012f92c 3135944d wwlib!FMain+0xfc1290012f950 3135926c wwlib!FMain+0x114e9e0012f95c 31359231 wwlib!FMain+0x114cbd0012f984 31244c5b wwlib!FMain+0x114c820012ff10 300015fb wwlib!FMain+0x6ac0012ff30 3000156d winword+0x15fb0012ffc0 77e6f32b winword+0x156d0012fff0 00000000 kernel32!BaseProcessStart+0x23Notes:- Reproduces on Windows Server 2003 (as an access violation) andWindows 7 (as a heap critical error)- Opening the document causes “Word experienced an error trying toopen the file.” dialog. After closing the dialog, and then closingWord, the crash occurs.- The dereference of the “heap free checking constant” suggests use-after-free.- Analysis shows the third argument of RtlpDebugPageHeapFree is0xfeeefeee - this suggests that a pointer from a previously freedchunk is itself being freed.- The callstack may suggest a misuse of the font embedding API. Forexample, this could be caused by multiple calls toTTDeleteEmbeddedFont using the same font reference handle.- Breakpointing the TTDeleteEmbeddedFont and recording the handleargument confirms that a font reference handle is deleted twice.- The test case reduces to a 1-bit difference from the original sample document.- The affected bit is in the lcbSttbfBkmkArto field of theFibRgFcLcb2007 (or FIBTable2007) structure.- Attached samples: 9adcab7c_1_crash.doc (crashing file),9adcab7c_1_orig.doc (original file)This bug is subject to a 90 day disclosure deadline. If 90 days elapsewithout a broadly available patch, then the bug report will automaticallybecome visible to the public. [TABLE] [TR][TD=width: 20] [/TD] [TD] 9adcab7c_1_crash.doc 1.2 MB Download [/TD] [/TR] [/TABLE] [TABLE][TR][TD] [/TD] [TD] 9adcab7c_1_orig.doc 1.2 MB Download[/TD][/TR][/TABLE]Sursa: https://code.google.com/p/google-security-research/issues/detail?id=107&can=1 Quote