Skip to content

Commit

Permalink
CVE-2019-0860 [ChakraCore] - possible Security Issue - Individual
Browse files Browse the repository at this point in the history
  • Loading branch information
pleath authored and akroshg committed Apr 8, 2019
1 parent 4cb3bbd commit 9a9ece6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3258,10 +3258,14 @@ GlobOpt::OptSrc(IR::Opnd *opnd, IR::Instr * *pInstr, Value **indirIndexValRef, I
}
originalPropertySym = sym->AsPropertySym();

// Dont give a vale to 'arguments' property sym to prevent field copy prop of 'arguments'
// Don't give a value to 'arguments' property sym to prevent field copy prop of 'arguments'
if (originalPropertySym->AsPropertySym()->m_propertyId == Js::PropertyIds::arguments &&
originalPropertySym->AsPropertySym()->m_fieldKind == PropertyKindData)
{
if (opnd->AsSymOpnd()->IsPropertySymOpnd())
{
this->FinishOptPropOp(instr, opnd->AsPropertySymOpnd());
}
return nullptr;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Backend/Lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6223,7 +6223,7 @@ Lowerer::GenerateLdFldWithCachedType(IR::Instr * instrLdFld, bool* continueAsHel

// Load the value from the slot, getting the slot ID from the cache.
uint16 index = propertySymOpnd->GetSlotIndex();
Assert(index != -1);
AssertOrFailFast(index != (uint16)-1);

if (opndSlotArray->IsRegOpnd())
{
Expand Down Expand Up @@ -7204,7 +7204,7 @@ Lowerer::GenerateDirectFieldStore(IR::Instr* instrStFld, IR::PropertySymOpnd* pr

// Store the value to the slot, getting the slot index from the cache.
uint16 index = propertySymOpnd->GetSlotIndex();
Assert(index != -1);
AssertOrFailFast(index != (uint16)-1);

#if defined(RECYCLER_WRITE_BARRIER_JIT) && (defined(_M_IX86) || defined(_M_AMD64))
if (opndSlotArray->IsRegOpnd())
Expand Down

0 comments on commit 9a9ece6

Please sign in to comment.