Skip to content

Commit

Permalink
[CVE-2018-8288] Edge - Chakra JIT ImplicitCallFlags check bypass with…
Browse files Browse the repository at this point in the history
… Intl - Google, Inc.
  • Loading branch information
rajatd authored and Atul Katti committed Jul 10, 2018
1 parent 0ac4253 commit f9b1cde
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions lib/Runtime/Library/IntlEngineInterfaceExtensionObject.cpp
Expand Up @@ -742,18 +742,11 @@ namespace Js
Js::Var args[] = { scriptContext->GetLibrary()->GetUndefined(), scriptContext->GetLibrary()->GetEngineInterfaceObject(), initType };
Js::CallInfo callInfo(Js::CallFlags_Value, _countof(args));

// Clear disable implicit call bit as initialization code doesn't have any side effect
Js::ImplicitCallFlags saveImplicitCallFlags = scriptContext->GetThreadContext()->GetImplicitCallFlags();
scriptContext->GetThreadContext()->ClearDisableImplicitFlags();

Js::Arguments arguments(callInfo, args);
BEGIN_SAFE_REENTRANT_CALL(scriptContext->GetThreadContext())
scriptContext->GetThreadContext()->ExecuteImplicitCall(function, Js::ImplicitCall_Accessor, [=]()->Js::Var
{
JavascriptFunction::CallRootFunctionInScript(function, arguments);
}
END_SAFE_REENTRANT_CALL

scriptContext->GetThreadContext()->SetImplicitCallFlags((Js::ImplicitCallFlags)(saveImplicitCallFlags));
return JavascriptFunction::CallRootFunctionInScript(function, arguments);
});

// Delete prototypes on functions if initialized Intl object
if (intlInitializationType == IntlInitializationType::Intl)
Expand Down

0 comments on commit f9b1cde

Please sign in to comment.