Skip to content

Commit 7af07fd

Browse files
atulkattiAtul Katti
authored andcommitted
[CVE-2018-8294] Edge - In Cross Context scenario check for new target first before marshalling the last parameter to a FrameDisplay - Internal
1 parent 227fc37 commit 7af07fd

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lib/Runtime/Base/CrossSite.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,12 @@ namespace Js
489489
{
490490
args.Values[i] = CrossSite::MarshalVar(targetScriptContext, args.Values[i]);
491491
}
492-
if (args.HasExtraArg())
492+
if (args.HasNewTarget())
493+
{
494+
// Last value is new.target
495+
args.Values[count] = CrossSite::MarshalVar(targetScriptContext, args.GetNewTarget());
496+
}
497+
else if (args.HasExtraArg())
493498
{
494499
// The final eval arg is a frame display that needs to be marshaled specially.
495500
args.Values[count] = CrossSite::MarshalFrameDisplay(targetScriptContext, args.GetFrameDisplay());

lib/Runtime/Language/Arguments.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ namespace Js
229229

230230
FrameDisplay* GetFrameDisplay() const
231231
{
232-
AssertOrFailFast(Info.Flags & CallFlags_ExtraArg);
232+
AssertOrFailFast((Info.Flags & CallFlags_ExtraArg) && (!this->HasNewTarget()));
233233

234234
// There is an extra arg, so values should have Count + 1 members
235235
return (FrameDisplay*)(this->Values[Info.Count]);

0 commit comments

Comments
 (0)