On Wed, Dec 3, 2014 at 9:04 AM, David Bruant <[email protected]> wrote: > A script which builds a weakmap may legitimately later assume the weakmap is > filled. However, passing the weakmap to a mixed-trusted (malicious or buggy) > script may result in the weakmap being cleared (and break the assumption of > the weakmap being filled and trigger all sorts of bugs). Like all dumb > things, at web-scale, it will happen.
OK. I read the whole thing, and I appreciate your writing it. There's something important that's implicit in this argument that I still don't have yet. If you were using literally any other data structure, any other object, passing a direct reference to it around to untrusted code would not only be dumb, but obviously something the ES spec should not try to defend against. Right? It would be goofy. The language just is not that hardened. Arguably, the point of a data structure is to be useful for storing data, not to be "secure" against code that **has a direct reference to it**. No? So what's missing here is, I imagine you must see WeakMap, unlike all the other builtin data structures, as a security feature. Specifically, it must be a kind of secure data structure where inserting or deleting particular keys and values into the WeakMap does *not* pose a threat, but deleting them all does. Can you explain that a bit more? I see the invariant you're talking about, I agree it's elegant, but to be useful it also has to line up with some plausible security use case and threat model. -j _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

