endo icon indicating copy to clipboard operation
endo copied to clipboard

add new ArrayBuffer, Array methods to whitelist?

Open dckc opened this issue 4 years ago • 6 comments

In MDN, Array.prototype.findLastIndex seems to be standard. I don't know why we're removing it.

I haven't researched the others. These are new as of a recent XS update.

Removing intrinsics.%ArrayBufferPrototype%.maxByteLength
Removing intrinsics.%ArrayBufferPrototype%.resizable
Removing intrinsics.%ArrayBufferPrototype%.resize
Removing intrinsics.%ArrayBufferPrototype%.transfer
Removing intrinsics.%ArrayPrototype%.findLast
Removing intrinsics.%ArrayPrototype%.findLastIndex
Removing intrinsics.%TypedArrayPrototype%.findLast
Removing intrinsics.%TypedArrayPrototype%.findLastIndex

dckc avatar Nov 11 '21 20:11 dckc

Lockdown only reports that it removed something if it’s not something we’ve explicitly thought about. We mute the warning for things that we know we want to remove.

I’m not sure whether we want to permit transfer or resize, in particular. We should clearly permit all the others. If we omit resize, we should rather tame it and set resizable to false. My inclination is just to make sure both of those methods are safe and include them. cc @erights

kriskowal avatar Nov 11 '21 22:11 kriskowal

These ArrayBuffer methods are stage 3. We probably should have a policy regarding inclusion of proposals, but the most sensible is likely to ignore anything not stage 4.

Regarding what to do regarding transfer and resize, I haven't really formed an opinion yet, but at first sight I don't see these operations as providing any more power than expected (they only modify the instance for resize, and also the provided argument for transfer). Regarding resize, we could probably make all instances non-resizable by overriding the constructor to drop the maximumByteLength option.

mhofman avatar Nov 12 '21 00:11 mhofman

... We probably should have a policy regarding inclusion of proposals, but the most sensible is likely to ignore anything not stage 4.

@erights said stage 3 in an Aug 2 comment.

dckc avatar Nov 12 '21 08:11 dckc

fixed in 824f085095ab56c007eb616143556197e615bcdf

release Coming Soon

dckc avatar Dec 05 '21 01:12 dckc

image

Still left 2 intrinsics

Jack-Works avatar Mar 03 '22 05:03 Jack-Works

@Jack-Works , thanks for reporting.

Reopening until these two are added to the whitelist. Perhaps we should also have a consistency check between methods of Array.prototype and members of @@unscopables

erights avatar Mar 03 '22 07:03 erights

Closing as fixed by https://github.com/endojs/endo/pull/1618

erights avatar Jun 08 '23 03:06 erights