Skip to content

Commit

Permalink
[CVE-2018-8133] Edge - Chakra: Type confusion with EntrySimpleObjectS…
Browse files Browse the repository at this point in the history
…lotGetter
  • Loading branch information
akroshg authored and MSLaguana committed May 8, 2018
1 parent 32ee5de commit 1b56f9f
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/Runtime/Base/CrossSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ namespace Js
}
#endif

// Marshaling should not cause any re-entrancy.
JS_REENTRANCY_LOCK(jsReentLock, scriptContext->GetThreadContext());

#if ENABLE_COPYONACCESS_ARRAY
JavascriptLibrary::CheckAndConvertCopyOnAccessNativeIntArray<Var>(object);
#endif
Expand Down Expand Up @@ -297,9 +300,18 @@ namespace Js
{
if (!dynamicObject->IsCrossSiteObject())
{
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObjectAndPrototype", object);
if (JavascriptProxy::Is(dynamicObject))
{
// We don't need to marshal the prototype chain in the case of Proxy. Otherwise we will go to the user code.
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObject", object);
MarshalDynamicObject(scriptContext, dynamicObject);
}
else
{
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObjectAndPrototype", object);

MarshalDynamicObjectAndPrototype(scriptContext, dynamicObject);
MarshalDynamicObjectAndPrototype(scriptContext, dynamicObject);
}
}
}
else
Expand Down

0 comments on commit 1b56f9f

Please sign in to comment.