Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(485)

Issue 8041020: Make sure that we can't access hidden properties by installing accessors on Object.prototype. (Closed)

Created:
9 years, 2 months ago by Rico
Modified:
9 years, 2 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Make sure that we can't access hidden properties by installing accessors on Object.prototype. BUG:chromium:97784 TEST=cctest/test-api Committed: http://code.google.com/p/v8/source/detail?r=9434

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -0 lines) Patch
M src/objects.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 chunk +28 lines, -0 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
Rico
9 years, 2 months ago (2011-09-26 12:50:26 UTC) #1
Lasse Reichstein
lgtm http://codereview.chromium.org/8041020/diff/1/test/cctest/test-api.cc File test/cctest/test-api.cc (right): http://codereview.chromium.org/8041020/diff/1/test/cctest/test-api.cc#newcode1837 test/cctest/test-api.cc:1837: CHECK_EQ(42, obj->GetHiddenValue(key)->Int32Value()); Should we prevent people from doing ...
9 years, 2 months ago (2011-09-26 13:02:21 UTC) #2
Rico
9 years, 2 months ago (2011-09-26 13:09:48 UTC) #3
http://codereview.chromium.org/8041020/diff/1/test/cctest/test-api.cc
File test/cctest/test-api.cc (right):

http://codereview.chromium.org/8041020/diff/1/test/cctest/test-api.cc#newcode...
test/cctest/test-api.cc:1837: CHECK_EQ(42,
obj->GetHiddenValue(key)->Int32Value());
On 2011/09/26 13:02:21, Lasse Reichstein wrote:
> Should we prevent people from doing SetHiddenValue("__proto__", ...) ? 
> 
> We really, really shouldn't have used an Object to store the properties if a
> plain Dictionary could have done the job. This is not the first time we have
> used an object for internal book-keeping, and got caught by acessors on
> Object.prototype.

As discussed offline, we should, but the real long term solution is to use a
dictionary instead of an object for storing these hidden properties. Since this
is a bug fix I am leaving as is for now.

Powered by Google App Engine
This is Rietveld 408576698