Closed GoogleCodeExporter closed 9 years ago
Note "Problem ignored by configuration (Unsafe spec violation):". I think this
is a known and explicitly permitted problem. Please try loading SES without
Caja configuration ( src/com/google/caja/ses/explicit.html ) and see if it
fails when run in the console there.
We deliberately ignore array mutability bugs beyond complete frozenness, to
gain performance, given that the Caja sandbox only relies on immutability when
the objects are fully frozen.
Original comment by kpreid@google.com
on 14 Aug 2014 at 10:41
At the debugger statement in fake1.js (I think that's in an SES environment)
the test case still violates the invariant.
Original comment by metaw...@gmail.com
on 14 Aug 2014 at 10:51
What's fake1.js?
Original comment by kpreid@google.com
on 14 Aug 2014 at 10:54
I don't know; it's part of the tests run by explicit.html. Just have your
console open when you refresh the page and it'll break there.
If I open the console after explicit.html is done and run the code, it still
shifts 0 off the array.
Original comment by metaw...@gmail.com
on 14 Aug 2014 at 10:57
Ah, I was looking at the wrong version. fake1.js is a filename made up by
explicit.html. This does seem to be a bug which is not repaired and not
reported as a problem.
MarkM, can you take this? I don't have the time currently.
Original comment by kpreid@google.com
on 14 Aug 2014 at 11:10
Yup. This is indeed a bug. I'll take it.
Original comment by erights@google.com
on 14 Aug 2014 at 11:16
Michael, Andreas (cc'ed),
This is caused by https://code.google.com/p/v8/issues/detail?id=3356 . Since
that bug is publicly visible, I ask here instead: What is the status of v8
issue 3356?
(Please don't discuss publicly at this time. Thanks.)
Original comment by erights
on 14 Aug 2014 at 11:24
On Canary at least, unshift, pop, and reverse suffer from this problem as well,
but splice and sort do not seem to.
Michael, Andreas,
Are splice and sort really safe, or did we just miss the problematic case?
Would it be safe for us to repair shift, unshift, and pop by redefining them in
terms of splice?
Does anything else suffer from this problem besides these four?
All,
Once this is public, we can now ask the community to contribute test262 tests
for these. (We can already ask for all the public SES tests that don't yet have
test262 tests, and should do so.)
Original comment by erights
on 15 Aug 2014 at 12:31
It looks like I was mistaken about reverse. AFAICT, it does not suffer from
this bug. AFAICT, that leaves only shift, unshift, and pop. If true, this is
nice, because all of these can be redefined in terms of splice.
Original comment by erights
on 15 Aug 2014 at 1:59
Nevermind. I'm making this public and unmarking it as a security issue, as all
the problems go away if the property is made non-writable, non-configurable.
Only the latter is security significant.
I am not closing this yet, since we should still have tests and repairs for the
significant case. I have started on these.
Original comment by erights
on 15 Aug 2014 at 1:20
Sigh, and damn. I was looking at the wrong thing. Even for non-writable,
non-configurable, we do have this problem for shift and unshift only. In any
case repairs coming soon.
Original comment by erights
on 15 Aug 2014 at 2:43
Remarking as Security / High. It is of course too late to remark as Private :(
Original comment by erights
on 15 Aug 2014 at 2:44
The only real issues are shift and unshift. All other flags I raise above were
due to my confusion.
See https://code.google.com/p/v8/issues/detail?id=3356#c3 comment 3.
Original comment by erights
on 18 Aug 2014 at 2:13
v8 properly prevents popping in the following, but issues the wrong error:
a=[7,8,9];
Object.defineProperty(a,2,{configurable:false});
a.pop();
// throws TypeError: Cannot define property:2, object is not extensible.
// instead of TypeError: Cannot delete property '2' of [object Array]
Original comment by metaw...@gmail.com
on 18 Aug 2014 at 4:42
@r5692
Changed title of this issue to reflect what has been fixed here. The underlying
v8 problem remains, but is a v8 issue.
Original comment by erights
on 19 Aug 2014 at 4:16
Original issue reported on code.google.com by
metaw...@gmail.com
on 14 Aug 2014 at 10:22