Re:WebAssembly doesn’t make unsafe languages safe
by wtracy on Sunday November 25, 2018 @07:10PM
(#18529950)
The simple version:
WebAssembly does protect the host from a compromised process. WebAssembly doesn't do jack to prevent a process (and whatever data it controls) from being compromised in the first place.
Re:WebAssembly doesn’t make unsafe languages safe
by hackcasual on Sunday November 25, 2018 @07:35PM
(#18530061)
It does in the sense that it totally protects the stack and doesn't allow creating new executable memory. Control flow can be manipulated, but then only via changing function pointers to other functions of the same type
Re:WebAssembly doesn’t make unsafe languages safe
by pjmlp on Monday November 26, 2018 @12:12AM
(#18531223)
Control flow can also be manipulated via memory corruption, making the existing code take other decisions, due to non valid semantic states.
Re:WebAssembly doesn’t make unsafe languages safe
by hackcasual on Monday November 26, 2018 @01:32AM
(#18531559)
Sure, but that's even weaker, since you can't even create new control flows, just cause surprising ones.
Re:WebAssembly doesn’t make unsafe languages safe
by pjmlp on Monday November 26, 2018 @03:23AM
(#18531885)
It is enough to work around authentication checks, for example.
Re:WebAssembly doesn’t make unsafe languages safe
by garmaine on Monday November 26, 2018 @06:43AM
(#18532614)
It doesn’t even do a particularly good job of that, given the size of the WebAssembly code base and reasonable bugs-per-kLOC assumptions. If you really want to protect the host then run a small, probably correct interpreter or JIT that is simplified enough to prove properties about and have an implementation small enough to be potentially bug free.
If you isolate untrusted code in a WebAssembly VM, that should reduce the attack surface for the system as a whole to whatever functions you expose into the WebAssembly VM.
Personally, my bias is to suggest that using Rust would significantly cut down on (but not eliminate) the attack surface inside the WebAssembly program... but some people don't like to hear that.