Skip to content

Commit 1b56f9f

Browse files
akroshgMSLaguana
authored andcommitted
[CVE-2018-8133] Edge - Chakra: Type confusion with EntrySimpleObjectSlotGetter
1 parent 32ee5de commit 1b56f9f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

lib/Runtime/Base/CrossSite.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ namespace Js
228228
}
229229
#endif
230230

231+
// Marshaling should not cause any re-entrancy.
232+
JS_REENTRANCY_LOCK(jsReentLock, scriptContext->GetThreadContext());
233+
231234
#if ENABLE_COPYONACCESS_ARRAY
232235
JavascriptLibrary::CheckAndConvertCopyOnAccessNativeIntArray<Var>(object);
233236
#endif
@@ -297,9 +300,18 @@ namespace Js
297300
{
298301
if (!dynamicObject->IsCrossSiteObject())
299302
{
300-
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObjectAndPrototype", object);
303+
if (JavascriptProxy::Is(dynamicObject))
304+
{
305+
// We don't need to marshal the prototype chain in the case of Proxy. Otherwise we will go to the user code.
306+
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObject", object);
307+
MarshalDynamicObject(scriptContext, dynamicObject);
308+
}
309+
else
310+
{
311+
TTD_XSITE_LOG(object->GetScriptContext(), "MarshalDynamicObjectAndPrototype", object);
301312

302-
MarshalDynamicObjectAndPrototype(scriptContext, dynamicObject);
313+
MarshalDynamicObjectAndPrototype(scriptContext, dynamicObject);
314+
}
303315
}
304316
}
305317
else

0 commit comments

Comments
 (0)