v8: backport fix for CVE-2013-{6639|6640}
authorjkummerow@chromium.org <jkummerow@chromium.org>
Fri, 13 Dec 2013 21:21:10 +0000 (14:21 -0700)
committerFedor Indutny <fedor.indutny@gmail.com>
Fri, 13 Dec 2013 22:55:29 +0000 (02:55 +0400)
commit39e2426b209799d5deaa29d2401dd98f060babda
treee83007fb0167da6d4aa4a44bd4978065c98cbcea
parent1d5e7974451b04cd10afa29ca86641ad5cf68f46
v8: backport fix for CVE-2013-{6639|6640}

Quoting CVE-2013-6639:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    write) or possibly have unspecified other impact via JavaScript code
    that sets the value of an array element with a crafted index.

Quoting CVE-2013-6640:

    The DehoistArrayIndex function in hydrogen-dehoist.cc in Google V8
    before 3.22.24.7, as used in Google Chrome before 31.0.1650.63,
    allows remote attackers to cause a denial of service (out-of-bounds
    read) via JavaScript code that sets a variable to the value of an
    array element with a crafted index.

Like 6b92a7, this is unlikely to affect node.js because it only runs
local, trusted code.  However, if there exists some module somewhere
that populates an array index with remotely provided data this could
very well be used to crash a remote server running node.  Defense in
depth and all.

This is a backport of upstream commit r17801. Original commit log:

    Limit size of dehoistable array indices

    LOG=Y
    BUG=chromium:319835,chromium:319860
    R=dslomov@chromium.org

    Review URL: https://codereview.chromium.org/74113002
deps/v8/src/elements-kind.cc
deps/v8/src/elements-kind.h
deps/v8/src/hydrogen-instructions.h
deps/v8/src/hydrogen.cc
deps/v8/src/lithium.cc
deps/v8/src/lithium.h
deps/v8/test/mjsunit/regress/regress-crbug-319835.js [new file with mode: 0644]
deps/v8/test/mjsunit/regress/regress-crbug-319860.js [new file with mode: 0644]