News for hackers. Stuff that matters.
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by codeflo on Tuesday May 30, 2023 @02:49AM (#36121857)
WebAssembly can interact with JavaScript, and JavaScript can access the DOM. This was a compromise to reduce attack surface and implementation effort, to get a version 1 out the door. Allowing direct DOM access would have required implementors to harden every individual DOM API to make sure the new call path doesn’t open any security holes. The WASM-to-JS layer is comparably tiny, and the JS-to-DOM layer is already there and (hopefully) secure.
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by xigoi on Tuesday May 30, 2023 @11:19AM (#36125901)
But doesn't it defeat the point of using WebAssembly, since you have to pass everything through JavaScript anyway (and therefore it's at the speed of JavaScript)?
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by taosx on Tuesday May 30, 2023 @11:31AM (#36126046)
In cases where you care about performance, yes. Newer webassembly frameworks (rust from what i remember) are batching operations to the DOM for that exact reason.
Re:Macro-ts: TypeScript compiler with typesafe syntactic mac... by cabalamat on Wednesday May 31, 2023 @10:51PM (#36147081)
But if WASM can call JS, and JS can then interact with the DOM, then doesn't tat allow WASM to exploit security holes in the DOM?