PushPopFrameHelper Use-After-Free Vulnerability
PushPopFrameHelper is a class that pushes the current stack frame object in its constructor and pops it in the destructor. However, InterpreterStackFrame::ProcessLinkFailedAsmJsModule uses it like a function, pushing and immediately popping the 'newInstance' object. This can lead to a Use-After-Free vulnerability, as demonstrated in the provided proof-of-concept code. The PoC will crash in the following code: Js::InterpreterStackFrame * interpreterFrame = executeFunction->GetScriptContext()->GetThreadContext()->GetLeafInterpreterFrame(); <<-- Invalid stack frame object loopHeader = executeFunction->GetLoopHeader(interpreterFrame->GetCurrentLoopNum()); <<-- interpreterFrame->GetCurrentLoopNum() == -1