by bastawhiz · 4y ago · 0 comments
Calling this "security" is hopefully not serious. "the properties of the object can no longer be changed" yes, unless someone else just unfreezes the object.
> That step addressed a security problem: prototype poisoning, in which objects created in traditional JavaScript were all mutable and can be subverted to confuse or surveil other parts of a program by anyone who had access to them.
This is still a problem, and the "harden" function that is described doesn't actually help because the things that it relies on could be poisoned.
From a practical security perspective, none of this actually accomplished anything or protects against any kind of bad actor doing something nefarious. I guess it's maybe useful as a comparison to E, but this article could have been a lot more direct and a lot less "we once did some stuff that is academically interesting in JavaScript."
As for harden(), whether its vulnerable to it's prototype chain in the way you describe depends entirely on how it's written. That said, these aren't amateurs so I expect they know what they're doing, and transitively freezing an object graph does add important security properties.
There doesn't appear to be any unfreeze method.
>This is still a problem, and the "harden" function that is described doesn't actually help because the things that it relies on could be poisoned.
I think the threat model here is untrusted code which runs after the "harden" function completes.
(I think this article would've been better if it had discussed threat models at the beginning.)