7 ms·
That's not an accurate summary. You can take over the browser by chaining exploits. Sections 5.1 and 5.2 show two examples. Needing to chain isn't as bad as
by chubot 6y ago
That's not an accurate summary. You can take over the browser by chaining exploits. Sections 5.1 and 5.2 show two examples.
Needing to chain isn't as bad as a full breakout, but in practice, attackers can and do chain exploits. (pwn2own has some really impressive chains, but those are about breaking out of the sandbox)
If you had written the code in JavaScript, this class of vulnerability would be impossible.
Also remember that WASM doesn't actually improve peak performance over JS. The asm.js subset of JS has the same performance.
WASM does two things 1) it makes performance predictable by ensuring you don't fall off a cliff of the JIT 2) It improves parsing time because it's loading a binary format rather than parsing JS.
e.g. notice that the headline here is about load time, not execution time, which would be more important: https://www.figma.com/blog/webassembly-cut-figmas-load-time-by-3x/ https://www.figma.com/blog/webassembly-cut-figmas-load-time-...
- modeless 6y agoYou can't take over the browser without chaining to a browser exploit, which is a much higher bar. If you already have a browser exploit I think you are unlikely to need to chain it from a wasm binary. You can potentially take over the page, but again only if you have vulnerabilities in the JavaScript interfacing with the wasm code. There is only one browser-based example in the paper and the vulnerability is due to using document.write which is always a security no-no.
- infogulch 6y agoI disagree with your disagreement. :) "oh but you can chain exploits" in this context is like if a php server takes POST data, passes it through an arbitrary but guaranteed to terminate "safe" function, and calls eval() on the result -- and then attributes potential vulnerabilities to the function. This seems silly, obviously the problem is the eval() at the end.
- emn13 6y agoAt the end of the day, if an attacker needs to chain exploits that's still a safer place to be that if they didn't need to do so. Additionally, how relevant is a link in an exploit chain when it's very likely the same overall effect could be had without using that link? Not very. And as you say, the examples given are really poor; they're barely exploits, that's more like a really unwise feature - it's hard to imagine situations like this arising in practice by accident without being more easily exploitable without even using WASM in the first place - I mean, if you're processing data in a some way and your interface with that processing code includes stuff like eval, that's just a disaster waiting to happen - as web exploits over the decades have demonstrated again, and again.
- magicalist 6y ago> You can take over the browser by chaining exploits. Sections 5.1 and 5.2 show two examples. 5.1 is XSS due to using document.write with a user provided string. That's not taking over the browser and is very much possible from JS (it's basically the prototypical XSS example from well before there was wasm). 5.2 is more serious but in node, not the browser, and is barely a chain (two exploits?). It's a way to get a string to eval() if eval() is available in one of the indirect functions. I think the authors also overstate the benefits of ASLR in that case. If that same code was running natively in a server and exposed to direct user input like that, it's very possible an RCE could be made to work. These examples are simple by design since they're just demonstrations that it's possible, so more sophisticated attacks are possible, but we also shouldn't over extrapolate from them.
- chubot 6y agoYeah I wasn't precise enough, I wrote a better summary here: https://news.ycombinator.com/item?id=26996738 https://news.ycombinator.com/item?id=26996738 tl;dr A bad case is if something like Figma stores your credit card info on the server. If they have a buffer overflow + document.write() of HTML derived from wasm code, the person who controls the image data could steal your credit card info. This is basically example 5.1; Figma is a huge chunk of C++ compiled to wasm, which may process images from other users.
- stefan_ 6y agoIt's a meaningless point in the chain. Browser security is not intended to be only for running "trusted" or known JavaScript or WebAssembly code and hence competitions like Pwn2Own are perfectly happy to have you navigate to your own page that then runs whatever WASM or JS you want. Nobody requires you to first find an XSS on HN for your exploit because getting someone to load a random page is an extremely low barrier.