I have an untrusted code submitted by a user, and I need to execute it in a sandboxed environment in a browser.
I was advised that Web-Workers cannot be secure enough for that, and that a sandbxed iframe should better be used. This page:
https://www.owasp.org/index.php/HTML5_Security_Cheat_Sheet#Web_Workers
also says workers are not suitable for untrusted code.
But if I create a worker from a Blob, its url even has a different protocol (blob://
). Is separate origin policy applied to the worker code in this case?
If there are additional reasons, why a worker is (by default) less restricted comparing to the sandboxed iframe (accesing IndexedDB or something else), is there any chance to set-up a worker somehow so that it would be restricted enough, or should I still use sandboxed iframe anyway?