Re:All About E: The Language That Infiltrated JavaScript
by goto11 on Thursday October 27, 2022 @05:13PM
(#33364121)
I guess I have a hard time seeing how Object.freeze() protects against malicious code, when any malicious script can still access the global object? I can understand something like the "Shadow realms" proposal, where a modules access to global objects can be constrained.
[ Parent
| on HN ]
Re:All About E: The Language That Infiltrated JavaScript
by kragen on Thursday October 27, 2022 @06:36PM
(#33364928)
In things like Jessie or ADsafe, confined scripts are screened to ensure that they do not access the global object.
Re:All About E: The Language That Infiltrated JavaScript
by goto11 on Friday October 28, 2022 @09:55AM
(#33371428)
So am I correct in the understanding that Object.freeze in JavaScript does not provide any useful protection against malicious code? But in a different language, or a hypothetical future version of JavaScript, it might play a role in such a protection?
Re:All About E: The Language That Infiltrated JavaScript
by kragen on Friday October 28, 2022 @12:45PM
(#33373893)
I think it provides, at best, very limited useful protection against malicious code that has access to the whole JS language, but it means that Jessie can include enormously more of JS than ADsafe did.