IEÔ¶³Ì´úÂëÖ´ÐÐÎó²î£¨CVE-2020-0674£©ÆÊÎö
Ðû²¼Ê±¼ä 2020-03-092020Äê1ÔÂ17ÈÕ£¬Î¢ÈíÐû²¼ÁËÕë¶ÔIEÔ¶³Ì´úÂëÖ´ÐÐÎó²î£¨CVE-2020-0674£©µÄSecurity Advisory(ADV200001)£¬²¢Ö¸³ö¸Ã0dayÎó²îÒѾ±»ÔËÓÃÓÚÕë¶ÔÐÔ¹¥»÷¡£ÏÖÔÚ£¬Î¢ÈíÒѾÐû²¼Ïà¹Ø²¹¶¡¾ÙÐÐÐÞ¸´¡£
¸ÃÎó²îÓ°Ïì×é¼þΪjscript.dll£¬¸Ã¶¯Ì¬Á´½Ó¿âÊÇ΢ÈíInternet Explorerä¯ÀÀÆ÷µÄJavascriptÒýÇæÖ®Ò»£¬ÆäÖÐIE8¼°ÒÔÏÂʹÓÃjscript.dll£¬IE9¼°ÒÔÉÏĬÈÏʹÓÃjscript9.dll£¬µ«ÍøÒ³¿ÉÒÔͨ¹ý<script>±êÇ©Ö¸¶¨ÔÚIE8¼æÈÝÐÔģʽϼÓÔØjscript.dll£¬Òò´ËIE9¡¢IE10¡¢IE11¶¼Êܵ½´ËÎó²îÓ°Ïì¡£´Ó²Ù×÷ϵͳ¹æÄ£À´¿´£¬±¾Îó²îÓ°Ïì¹æÄ£ºá¿çWindows 7ÖÁWindows 10ÖÐËùÓеÄСÎÒ˽¼Ò²Ù×÷ϵͳºÍ·þÎñÆ÷²Ù×÷ϵͳ¡£
¸ÃÎó²îÊÇÒ»¸öUse-After-FreeÎó²î£¬¹¥»÷Ñù±¾Ê¹ÓÃUAF¸æ¿¢ÀàÐÍ»ìÏý£¬½ø¶ø»ñÈ¡È«¾ÖÄÚ´æ¶ÁдÄÜÁ¦²¢ÈƹýASLRµÈÎó²îʹÓûº½âÊÖÒÕ£¬²¢´ÓÖ¸¶¨ipµØµãÇëÇóÏÂÒ»²½¹¥»÷Ôغɣ¬×îÖÕµÖ´ïÔ¶³Ì´úÂëÖ´ÐС£
ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÇå¾²Ñо¿Ô±Æ¾Ö¤·´²¡¶¾³§É̲¶»ñµ½µÄÑù±¾¶Ô´ËÎó²î¾ÙÐÐÁËÆÊÎö£¬·¢Ã÷Îó²îCVE-2020-0674×ÅʵÓëCVE-2019-1429´ÓÎó²îÔÀíÉÏÊÇͳһ¸öÎó²î£¬µ«´¥·¢Îó²îµÄÑù±¾½ØÈ»²î±ð£¬Á½´ÎÍƳöµÄ²¹¶¡Ò²²»ÍêÈ«Ïàͬ¡£
Ó¦¶Ô²½·¥
ʹÓÃWindows¸üкͲ¹¶¡ÐÞ¸´´ËÎó²î¡£
½ûÓÃjscript.dll£¬Security Advisory(ADV200001)ÖÐÒѾ¸ø³ö£º
Îó²îºÍ²¹¶¡ÆÊÎö
PART1
ÔÚ¿ªÆôÒ³¶ÑµÄIEä¯ÀÀÆ÷Öе÷ÊÔ£¬Íß½âÏÖ³¡ÈçÏ£º
ƾ֤ջ»ØËÝ¿ÉÒÔ¶ÔÓ¦µ½htmlÑù±¾µÄtypeofŲÓá£ÔÚÑù±¾ÖУ¬¾ÓÉÖØ´óµÄÒýÓòÙ×÷£¬ÔÚarr3ÖУ¬Ç°Ò»²¿·ÖÔªËØÓ¦¸ÃΪundefined£¬ºóÒ»²¿·ÖÔªËØӦΪRegExp¹¤¾ß£¬µ«Ê¹ÓÃtypeof»á¼ûijԪËØʱ±¨´íΪ¡°ÒÑÊͷŵÄÒ³¶Ñ¿Õ¼ä¡±£¬¿ÉÒÔ¿´³öÕâÊÇÒ»¸öÓÉÀ¬»ø½ÓÄÉ»úÖÆÒýÆðµÄÎÊÌâ¡£ÔÚÓû§Ä¬ÈÏÉèÖÃÏ£¬¼´Î´¿ªÆôÒ³¶Ñʱ£¬arr3ÖеÄijһ¸öÔªËØi»áµ¼ÖÂarr3[i]) === "number"½¨É裬´Ëʱ¼´Òý·¢ÀàÐÍ»ìÏý¡£
IE jscriptµÄÀ¬»ø½ÓÄÉ(Garbage Collect, GC)»ùÓÚMark-SweepËã·¨£¬¼´´Ó½ç˵Ϊ¡°¸ù¡±µÄÊý¾Ý½á¹¹×îÏÈ£¬Ñ°ÕÒÆäËùÓÐÒýÓõ½µÄ¹¤¾ß±ê¼ÇΪÕýÔÚʹÓ㬶øûÓÐÔÚ±ê¼ÇµÄ¹¤¾ß±»¿´³É²»ÔÙʹÓã¬ÆäÄÚ´æ¿Õ¼ä½«ÔÚÀ¬»ø½ÓÄÉÀú³ÌÖб»ÊÍ·Å¡£Òò´Ë´ÓÍß½âÏÖ³¡¿´£¬±¾Îó²îµÄ³ÉÒòÊÇMark-SweepµÄ±ê¼ÇÀú³Ì·ºÆðÁËÎÊÌ⣬Ҳ¾ÍÊǹ¤¾ßÖ®¼äµÄÒýÓ÷ºÆðÁËÎÊÌâ¡£
²¹¶¡ÆÊÎöµÄ½áÂÛÖ§³ÖÁËÉÏÊöÍƲ⡣װÖò¹¶¡ºó£¬¶ÔоÉjscript.dll¾ÙÐÐbin diff£¬¿ÉÒÔ¿´µ½À¬»ø½ÓÄÉËã·¨ÔÚ¶à¸ö¹¤¾ßµÄ±ê¼ÇÀú³Ì(Scavenge)×ÅÖØ´¦Öóͷ£ÁËÒ»¸öֵΪ0x400CµÄÌØÊâÇéÐΣ¬ÒÔNameList¹¤¾ßΪÀý£º
ƾ֤ÄæÏòÆÊÎöºÍÎĵµ£¬Õâ¸öö¾ÙÀàÐ͵ÄÖµÊÇVARIANT->VarTypeÓò¡£ÆäÖУ¬0x400C´ú±í¸Ã¹¤¾ßÊÇÒ»¸öÖ¸ÕëÀàÐ͵Ť¾ß£¬Ö¸ÏòÁíÒ»¸öVARIANT£¬ÆäÖ¸ÕëÓòλÓÚoffset 8µÄλÖã¬Ò²¼´*((_DOWORD *)i + 2)¡£¿ÉÒÔ¿´µ½£¬´Ë´¦µÄÐÞ²¹ÊÇÈ¡³öÖ¸ÕëÖµ£¬×ª´ï¸øVAR::Scavengeº¯Êý¡£¶øVAR::ScavengeÔٴζÔ0x400CµÄö¾ÙÐͱäÁ¿Ìí¼ÓÁËÌØÊâ´¦Öóͷ££º
VAR::Scavengeº¯Êý¶Ô´«È빤¾ßµü´úµØ½âÒýÓã¬Ö±µ½»ñµÃ·ÇÖ¸ÕëµÄ¹¤¾ß£¬Ò²¼´Èô¸É²ãÖ¸ÕëµÄ×îÖÕÖ¸Ïò£¬½«Æä´«ÈëGcContext::ScavengeVar¡£GcContext::ScavengeVarº¯ÊýÂß¼½ÏΪ¼òÆÓ£¬¸Ãº¯Êýͨ¹ýÓë0xF7FFµÄÓë²ÙÞÏÞεóÄÑ´«È빤¾ß¾ÙÐбê¼Ç£¬¸ÃÓë²Ù×÷Êǽ«µÚ12λÇåÁã¡£
¾ÓɲâÊÔ£¬CVE-2019-1429ÓëCVE-2020-0674µÄÑù±¾ÔÚ¸÷¸ö¡°Î´ÐÞ¸´¡±ºÍ¡°ÒÑÐÞ¸´¡±°æ±¾ÖÐÌåÏÖÍêÈ«Ò»Ö¡£ÆäUAFµÄ¹¤¾ßµÄ±ê¼ÇÀú³Ìȷʵ¾ÓÉNameList::ScavengeCore£¬ÔÚCVE-2019-1429ÖÐÊÇArrayË÷ÒýµÄObject¹¤¾ß£¬ÔÚCVE-2020-0674ÖÐÊÇArrayË÷ÒýµÄRegExp¹¤¾ß£¬NameList::ScavengeCore¾öÒéÁËÆäÊÇ·ñ±»±ê¼Ç¡£
Òò´Ë¹ØÓÚ±¾Îó²îµÄ³ÉÒòµÃ³ö½áÂÛ£ºÔÚMark-Sweep±ê¼ÇËã·¨ÖУ¬Óöµ½Ö¸ÕëÀàÐ͵Ť¾ßʱӦ¸Ã½âÒýÓò¢±ê¼Ç¶ÔÓ¦¹¤¾ß£»±¾ÀýÖУ¬È±·¦½âÒýÓõÄÀú³Ìµ¼ÖÂÁËÎó²îµÄ±¬·¢¡£
PART2
½øÒ»²½ÆÊÎö¿ÉÒÔ·¢Ã÷£¬Õë¶ÔCVE-2019-1429ºÍCVE-2020-0674΢ÈíÏȺóÍƳöÁËÁ½¸öpatch£¬ÒÔWindows 10 Version 1903 for 32-bit SystemsΪÀý£¬»®·ÖÊÇKB4524570ºÍKB4532693£¬µ«×îÖÕ¶¼Éý¼¶µ½ºóÕߣº
KB4524570ºÍKB4532693¶¼°üÀ¨Á˶ÔÉÏÊöÎó²î½¹µãÔÀíµÄÐÞ¸´£¬ÆäÖÐÇ°Õ߶Ôjscript.dllÓнϴó¸Ä¶¯£¬´ËºóÕ߸Ķ¯Ôò¾«Á·Ðí¶à¡£KB4532693»¹°üÀ¨ÁíÒ»¸öˢУ¬Ê¹Óá°ÈßÓàÈÝÔÖ¡±µÄ˼Ð÷ÌṩÁËÁíÒ»´¦ÔöÇ¿£»´Ë´¦ÔöǿλÓÚJavascriptÒýÇæÖÐcallºÍdispatchµÄ»ù´¡ÉèÊ©ÖУ¬¶ø²»ÊǶÔÖÖÖÖ¹¤¾ßÖð¸öµ÷½â¡£
KB4532693¶Ôjscript.dllÖеÄScrFncObj::Callº¯Êý¾ÙÐÐÁËÖØÐÂ×éÖ¯£¬¹ØÓÚCallWithFrameOnStackºÍCallWithFrameOnHeap(×Ô½ç˵Ãû³Æ)ÕâÁ½ÖÖÇéÐΣ¬ÓÃScrFncObj::PerformCallͳһ¡£ÔÚScrFncObj::PerformCallÖУ¬°ÑŲÓÃʹÓõĺ¯Êý²ÎÊý¼ÓÈëÀ¬»ø½ÓÄɵġ°¸ù¡±ÖУº
¾ÓÉÑéÖ¤£¬ÔÚPerformCallµÄ¼Ó¹ÌÏ£¬×ÝÈ»NameListµÈ¹¤¾ß·ºÆðÎÊÌ⣬ÔÚº¯ÊýŲÓÃÖÐ×÷Ϊ²ÎÊýµÄ¹¤¾ßÈÔÈ»±»×¼È·±ê¼Ç£¬²»»á´¥·¢Îó²î¡£Òò¶øËäÈ»Á½¸ö²¹¶¡¶¼¿ÉÒÔÍêÈ«µÖÓùÁ½¸öCVEµÄexploit£¬ÈÔ¿ÉÒÔÒÔΪKB4532693ÊDZÈKB4524570ÉÔ΢¸ßÃ÷Ò»µãµÄÐÞ²¹¡£
PART3
³ý´ËÖ®Í⣬Á½¸ö²¹¶¡ËäÈ»Äܹ»ÔÚĬÈÏÉèÖÃϵÖÓùÉÏÊöÎó²î£¬¶ÔÓ¦jscript.dllÈÔÈ»ÓÐÒ»¸ö³ÆΪLegacyGCµÄ¼æÈÝÏÒÑÐÞ²¹´úÂëÖÐÈÔȻƾ֤GcContext::IsLegacyGCEnabled()µÄº¯ÊýÅÌÎÊЧ¹ûÀ´Åжϼì²éÊÇ·ñ½éÈ롣ƾ֤ÄæÏòÆÊÎö¿ÉÖª£¬¸Ãº¯ÊýÅÌÎÊÒ»¸ö×¢²á±íÏ
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\ee1ca8aa-4402-4da1-bbe2-69a09c483a56
ÔÚ´ËÏîΪ1ʱÒâΪ¡°¼æÈÝʹÓÃÀϵÄGC»úÖÆ¡±£¬½«Ê¹KB4532693ÖеÄÔöǿʧЧ£¬¹ØÓÚKB4524570Ôò»áÍêȫʧЧ¡£Òò´Ë¸Ã×¢²á±íÏîµÄÄÚÈÝÒ²Éæ¼°IEä¯ÀÀÆ÷µÄÇå¾²ÐÔ£¬ÐèÒªÓèÒÔ×¢ÖØ¡£
²Î¿¼Á´½Ó£º
1.https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/ADV200001
2.https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2019-1429
3.https://www.virustotal.com