¡¾Ô´´Îó²î¡¿WebAssembly¸ßΣÎó²îÓ°ÏìEdgeºÍSafariä¯ÀÀÆ÷
Ðû²¼Ê±¼ä 2019-03-26Îó²î¸ÅÊö
2018Äê10Ô£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLab·¢Ã÷ä¯ÀÀÆ÷WebAssemblyÄ£¿é±£´æ¸ßΣÎó²î£¬²¢µÚһʱ¼äת´ïÆ»¹ûºÍ΢Èí¹Ù·½¾ÙÐÐÐÞ¸´¡£¸ÃÎó²îλÓÚ¶ÔÓ¦ä¯ÀÀÆ÷JavaScriptÒýÇæ(JavaScriptCore/ChakraCore)ÓëWebAssemblyÄ£¿éµÄ½Ó¿Ú£¬¿ÉͬʱӰÏìEdge¡¢Safariä¯ÀÀÆ÷¡£
Îó²îÓ°Ïì¹æÄ£
Apple iOS/macOS²Ù×÷ϵͳµÄSafariä¯ÀÀÆ÷
ÆäËûƽ̨ÉÏ»ùÓÚWebKitµÄ×é¼þºÍ²úÆ·
Îó²î¼òÎö
¹¥»÷Õß¿Éͨ¹ýÈ«ÐĽṹµÄhtmlÍøÒ³£¬Ê¹Óû§ÔÚʹÓÃä¯ÀÀÆ÷»á¼ûÍøҳʱ´¥·¢Îó²î¡£¸ÃÎó²îÔÚä¯ÀÀÆ÷Îó²îʹÓÃÖпÉÒÔÖ±½Ó×÷ΪfakeobjÔÓͨ³£addrofÓëfakeobjÔÓïÍŽá¿ÉÒÔÖ±½Ó»ñµÃí§Òâ´úÂëÖ´ÐеÄÄÜÁ¦£¬ÔÚһЩÌØÊâÇéÐÎÏ£¬µ¥¶ÀʹÓÃfakeobjÔÓïÒ²¿ÉÒÔÍê³ÉÎó²îʹÓá£
WebAssemblyModuleRecord::linkÈÏÕæÆÊÎöWebAssemblyÄ£¿éÖеĸ÷¸ö½á¹¹£¬ÔÚÆÊÎöµ¼³ö±íʱ£¬ÓУº

ÔÚ¼ÓÔص¼³öµÄÈ«¾Ö±äÁ¿Ê±£¬ÓÐWasm::I32¡¢Wasm::I64¡¢Wasm::F32¡¢Wasm::F64ËÄÖÖÀàÐÍ£¬ÊÇWebAssembly±ê×¼ÖÐÖ¸¶¨µÄÊý¾ÝÀàÐÍ(descriptor)£¬»®·ÖÌåÏÖ32λ¡¢64λµÄÕûÊýºÍ¸¡µãÊý£¬ÔÚ.wasmÎļþÖÐÓÃÒ»¸ö×Ö½ÚÈ·¶¨£»Ëæºóƾ֤±äÁ¿ÀàÐ͵ij¤¶È´Ó.wasmÎļþÖмÌÐøÈ¡³öÏêϸÊý¾Ý(value)£¬·â×°³ÉJSValue¹©JavaScriptÉÏÏÂÎÄʹÓá£

Release°æ±¾»áÔÚ±àÒëÀú³Ì½«isImpureNaNÕâÒ»¼ì²éÈ¥µô£¬´ËʱÍâÀ´Êý¾ÝÈôÊÇÊÇÒ»¸öNaN(Not a Number)£¬ÀýÈç0xffff000000888888£¬ÔÚͨ¹ý¼Ó·¨(+DoubleEncodeOffset)·â×°³ÉJSValueʱ»á±¬·¢Òç³ö£¬Äð³É0x888888¡£ÓÉÓÚSafariµÄboxing¹æÔò£¬ÕâÑùµÄÒ»¸öJSValue»á±»¿´³ÉÖ¸Õ룬Òò¶ø±¬·¢ÀàÐÍ»ìÏýÎó²î¡£

Edgeä¯ÀÀÆ÷µÄÎó²îºÍ²¹¶¡Ò²ºÜÊÇÏàËÆ£º

¿ÉÒÔ¿´µ½£¬ÔÚWebAssembly±ê×¼µÄʵÏÖÖÐ΢Èí¡¢Æ»¹û·¸ÁËÀàËƵĹýʧ£¬µ¼ÖÂÎó²îµÄÃæÄ¿Ò²¼«ÆäÏàËÆ£¬Îó²îÔÀíÒ²²¢²»Öش󡣸ÃÎó²îÊÇÔÚWebAssembly¹¦Ð§ÊµÏÖʱֱ½ÓÒýÈëµÄ£¬ÔÚEdge¡¢SafariÖÐÒÑDZÔÚÁË2Äê¡£
ÁíÒ»·½Ã棬ÓÉÓÚJavaScriptÒýÇæÒ²ÎÞ·¨ÓÅÒìµØʵÏÖi64ÀàÐ͵ÄWebAssembly±äÁ¿£¬Òò´ËÎÞÂÛÊÇSafari/WebKitÕÕ¾ÉEdge¶¼¾Ü¾ø¶Ô¸ÃÀàÐͼ°¾ÙÐд¦Öóͷ£¡£MDNÒ²ÔÚWebAssemblyµ¼³öº¯ÊýÕ½ÚÌáµ½£º¡°ÈôÊÇÄãʵÑéŲÓÃÒ»¸ö½ÓÊÜ»ò·µ»ØÒ»¸öi64ÀàÐ͵¼³öµÄwasmº¯Êý£¬ÏÖÔÚËü»áÅ׳öÒ»¸ö¹ýʧ£¬ÓÉÓÚJavaScriptûÓÐ׼ȷµÄ·½·¨À´±êʶһ¸öi64¡£²»¹ý£¬ÕâÔÚδÀ´¿ÉÄÜ»á¸Ä±ä¡ª¡ªÔÚδÀ´µÄ±ê×¼ÖУ¬½«Ë¼Á¿ÐµÄi64ÀàÐÍ¡£½ìʱ£¬wasm¿ÉÒÔʹÓÃËü¡±¡£
Õâ¸øÎÒÃǵÄÆôʾ£º
²î±ðÄ£¿éñîÊÊʱ¿ÉÄÜ»áÍ»ÆÆijģ¿éÄÚ²¿µÄ¼ÙÉ裬ÐèÒªÉóÉ÷¿´´ý¡£
ƾ֤¸ÃÎó²îµÄÌص㣬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÒÑÒ»Á¬·¢Ã÷ÁËÈô¸ÉÎó²îºÍ´úÂëÎÊÌ⣬²¢ÒÑת´ï³§É̾ÙÐÐÐÞ¸´¡£
Îó²îʱ¼äÖá
2018Äê11ÔÂ6ÈÕ£¬ÓÅ·¢¹ú¼ÊÍøÕ¾¹ÙÍøADLabÏò΢ÈíÌá½»Îó²î¡£
2018Äê11ÔÂ27ÈÕ£¬Æ»¹ûÔÚWebKit´úÂë¿âÖÐÐÞ¸´Îó²î¡£
2019Äê1ÔÂ24ÈÕ£¬Î¢ÈíÔÚChakraCore´úÂë¿âÖÐÐÞ¸´Îó²î¡£
2019Äê2ÔÂ12ÈÕ£¬Î¢ÈíΪEdgeä¯ÀÀÆ÷ÍÆËÍÇå¾²ÐÔ¸üУ¬²¢Åû¶CVE±àºÅ¡£
2019Äê3ÔÂ25ÈÕ£¬Æ»¹ûΪSafariä¯ÀÀÆ÷µÈ²úÆ·ÍÆËÍÇå¾²ÐÔ¸üУ¬²¢Åû¶CVE±àºÅ¡£
Çå¾²½¨Òé
ΪÁËÀû±ãÉçÇøТ˳´úÂ룬Edge¡¢SafariÔÚÄڵij£¼ûä¯ÀÀÆ÷²úÆ·ÍùÍù½«½¹µãÒýÇæ×é¼þ¿ªÔ´£¬¶ø¿ªÔ´´úÂë¿ÍÕ»ÖеÄÿ´Î²¹¶¡Ìá½»¾ù°üÀ¨²¿·ÖÎó²îÐÅÏ¢¡£Òò´ËÔÚ³§ÉÌÕýʽÅû¶Îó²î²¢Îª²úÆ·ÍÆËͲ¹¶¡Ö®Ç°£¬ºÚ¿ÍÓÐÒ»¸ö½á¹¹Îó²îPOCµÄ¹¥»÷ʱ¼ä´°¡£ÎªÁËËõСÕâһʱ¼ä´°£¬ÖÕ¶ËÓû§Ó¦ÊµÊ±×°Öó§ÉÌÌṩµÄÇå¾²ÐÔ¸üС£
²Î¿¼Á´½Ó£º
https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2019-0607https://support.apple.com/en-us/HT209599
https://developer.mozilla.org/zh-CN/docs/WebAssembly/Exported_functions
