5 ms·
I can’t find it right now but I read a paper that showed that the WASM security model is weaker than native compiled code in some cases. For example, due to com
by vlovich123 5y ago
I can’t find it right now but I read a paper that showed that the WASM security model is weaker than native compiled code in some cases. For example, due to compiler and OS hardening techniques, exploits of a libpng flaw weren’t exploitable unless run in WASM. You couldn’t escape the WASM sandbox but the a application itself could be compromised.
I’m sure that this approach is valid as a hardening measure but some of the enthusiasm in the post is perhaps worthy of temperance. This thunk through WASM can’t protect against runtime heap overflows and such.
> However, the transformation places two key restrictions on the target code: it can’t jump to unexpected parts of the rest of the program, and it can’t access memory outside of a specified region
Oof. The paper I recall specifically called these out as not enforceable. The libpng example in the paper directly had an external request have libpng corrupt and access other WASM memory than it owned (in this model it would be other in-process native memory I think or at least the other code placed within the same heap region unless each component gets its own which then means you need to have a fixed memory allocated upfront…).
- Deukhoofd 5y ago> WASM security model is weaker than native compiled code in some cases. For example, due to compiler and OS hardening techniques, exploits of a libpng flaw weren’t exploitable unless run in WASM. If I understand the post correctly, it's still native compiled code in the end, and it won't run through WASM. The goal of the approach sounds more like a code sanitizer tool to ensure the external library they're using isn't making calls outside of it, or requesting memory beyond the region its given.
- miloignis 5y agoAre you perhaps thinking of "Everything Old is New Again: Binary Security of WebAssembly"? ( https://www.usenix.org/system/files/sec20-lehmann.pdf https://www.usenix.org/system/files/sec20-lehmann.pdf ) In any case, I think you've misunderstood the security properties. WASM can have weaker security within the sandbox because it doesn't have access to some of the more sophisticated mitigation measures that native code does, but the security of the sandbox boundary itself is very solid. The part of the article that you quote is accurate in the sense that I believe it was meant - the code cannot jump to unexpected parts of the rest of the program (outside the sandbox) and cannot access memory outside of a specified region (the sandboxed memory). A vulnerability might allow the target code to jump to somewhat unexpected parts inside the sandbox, or buffer overflows inside the sandbox, but not outside. As such, it's actually a really effective application of a WASM sandbox!
- titzer 5y ago> WASM can have weaker security within the sandbox because it doesn't have access to some of the more sophisticated mitigation measures that native code does, And that's mostly read-only data pages. The primary blocker there is how to integrate that capability with ArrayBuffer in the web platform, since Wasm memories can be exposed (or aliased) as ArrayBuffer objects, and most engines aren't prepared to encourage non-writable holes in ArrayBuffers.
- pjmlp 5y agoTriggering a fire inside the castle might be enough to change the output of calls being done into the sandbox, it doesn't need to escape it to be exploitable.
- miloignis 5y agoThey're addressing this as well - from the article: > This, in turn, makes it easy to apply without major refactoring: the programmer only needs to sanitize any values that come from the sandbox (since they could be maliciously-crafted), a task which RLBox makes easy with a tainting layer.
- pjmlp 5y agoProgrammer only needs to sanitize.... You mean like all those great programmers that keep introducing bugs like the one recently found out by Project Zero?
- vlovich123 5y agoYes! Thanks so much for finding it, that's exactly the paper. > A vulnerability might allow the target code to jump to somewhat unexpected parts inside the sandbox, or buffer overflows inside the sandbox, but not outside. As such, it's actually a really effective application of a WASM sandbox! Again, don't get me wrong. This is a very interesting idea to explore. The paper does point out ways that the host JS environment (which in this case can be considered the FF native process) can be exploited. Not as easily as a heap overflow, but not necessarily trivially either. I think both that paper & this post lay out an interesting idea on how to better lock down native extensions.