WebAssembly actually has the potential to help with this. It's being built with security as a primary consideration, it's a lot more limited in what it's allowed to do than Javascript, and the fact ...
The Bytecode Alliance aims to promote safe use—and reuse—of untrusted code at speed. The more interesting aspect is its use outside of the browser. For example, to have a sandboxed plugin ecosystem ...