4 ms·
> WASM doesn't do bounds checking inside linear memory segments, good luck preventing corruption on data structures stored on the same segment. Isn't the point
by masklinn 5y ago
> WASM doesn't do bounds checking inside linear memory segments, good luck preventing corruption on data structures stored on the same segment.
Isn't the point that you don't care?
Each untrusted library is compiled to wasm then C then native, they can corrupt their own datastructures but the point is to prevent that corruption from escaping those boundaries, or at least that's how I understand it.
- azakai 5y agoMostly that's the case, yes. The main benefit of wasm sandboxing in this situation is to keep any exploit of these libraries in the sandbox - no memory corruption outside. That's a big improvement on running the same code outside of a sandbox. (But in general corruption inside the sandbox is potentially dangerous too. You need to be careful about what you do with data you get from the sandboxed code. RLBox does help in that area as well.)
- pjmlp 5y agoJust because corruption doesn't escape the sandbox doesn't means it isn't exploitable. This like attacking microservices, you have a module that exposes a set of interfaces and produces outputs when called with specific APIs. For the sake of example lets say you have an authentication module that says if a given user id is root. Now imagine producing a sequence of API calls that it will trigger the side effect of is_root(id) being true for an id that it is a plain user. No sandbox escape took place, only internal corruption of internal data keeping structures that lead the is_root() to misbehave.
- Dylan16807 5y agoThe code implementing is_root is not an untrusted module.
- est31 5y agoThink of some online banking application written in C++ and compiled to the web. With js, they only have to worry about css exploits and similar. If they use C++, suddenly they also have to worry about all the C++ bugs, too.