Skip to content

Commit

Permalink
[CVE-2018-8294] Edge - In Cross Context scenario check for new target…
Browse files Browse the repository at this point in the history
… first before marshalling the last parameter to a FrameDisplay - Internal
  • Loading branch information
atulkatti authored and Atul Katti committed Jul 10, 2018
1 parent 227fc37 commit 7af07fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/Runtime/Base/CrossSite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,12 @@ namespace Js
{
args.Values[i] = CrossSite::MarshalVar(targetScriptContext, args.Values[i]);
}
if (args.HasExtraArg())
if (args.HasNewTarget())
{
// Last value is new.target
args.Values[count] = CrossSite::MarshalVar(targetScriptContext, args.GetNewTarget());
}
else if (args.HasExtraArg())
{
// The final eval arg is a frame display that needs to be marshaled specially.
args.Values[count] = CrossSite::MarshalFrameDisplay(targetScriptContext, args.GetFrameDisplay());
Expand Down
2 changes: 1 addition & 1 deletion lib/Runtime/Language/Arguments.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ namespace Js

FrameDisplay* GetFrameDisplay() const
{
AssertOrFailFast(Info.Flags & CallFlags_ExtraArg);
AssertOrFailFast((Info.Flags & CallFlags_ExtraArg) && (!this->HasNewTarget()));

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

0 comments on commit 7af07fd

Please sign in to comment.