Live data from Hacker News

PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

leaningtech.com

31–40 of 111 posts

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#31
Nice work. I love simple and "conservative brute force" techniques like this--brute force in that you run all the example call sites in the interpreter, conservative in that it bails out when things get hard (e.g. bail out if a single basic block is executed too many times).

I am wondering if this technique could be hybridized with abstract interpretation or partial evaluation, which are known techniques in compilers. In essence, this would become a type of concolic execution.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#32
post #9

This company has an x86-to-WASM compiler that lets you execute arbitrary binaries in the browser. Also a JVM to WASM transpiler. There's a fantastic Meetup presentation given by one of them where they show running a C++ multiplayer game with both client AND server running in a browser, using WebRTC as a networking polyfill. Really mindblowing: https://youtu.be/7JUs4c99-mo?t=167

What would the impact be on battery life compared to native execution? Can one get it just as power efficient as native execution, only slower? For computationally less intensive applications browser portability might be an excellent tradeoff.

It gives a new meaning to the slogan "write once, run everywhere".

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#33
post #28

Earlier quoted context omitted.

There is a very big difference: ActiveX was native code that was literally running on your system with full access to system calls. CheerpX is a Virtual Machine environment, it JIT compiles Wasm code from x86 binaries and it is fully sandboxed by the browser. It _cannot_ access your system even if it tried.

It can still be exploited the Applets/Flash way, by forcing the internal memory to become corrupted and with it change its behaviour.

It literally cannot.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#34
post #17
post #9

This company has an x86-to-WASM compiler that lets you execute arbitrary binaries in the browser. Also a JVM to WASM transpiler. There's a fantastic Meetup presentation given by one of them where they show running a C++ multiplayer game with both client AND server running in a browser, using WebRTC as a networking polyfill. Really mindblowing: https://youtu.be/7JUs4c99-mo?t=167

At what point does the browser become an "os", what's next? Chrome hypervisor?

It happened about a decade ago.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#36
post #28

Earlier quoted context omitted.

There is a very big difference: ActiveX was native code that was literally running on your system with full access to system calls. CheerpX is a Virtual Machine environment, it JIT compiles Wasm code from x86 binaries and it is fully sandboxed by the browser. It _cannot_ access your system even if it tried.

It can still be exploited the Applets/Flash way, by forcing the internal memory to become corrupted and with it change its behaviour.

Right, you can corrupt memory and thereby alter behavior, but that memory is a managed array. You can't corrupt anything outside of the application's own memory. As you say, you can change behavior, and thereby do whatever you want with whatever the wasm application is allowed to access. Which is a very limited set of things.

Likening it to Java applets or Flash is deceptive -- yes, you can still hack them and exploit vulnerabilities. But the scope of what you can do with such vulnerabilities is wildly, dramatically different. Even when sandboxed, Flash has an enormously wider attack surface to play with. WebAssembly has barely anything.

It's like the difference between patching a leak in your roof with a sponge vs tar paper. In theory, water could find a path through the tar paper.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#37
post #17
post #9

This company has an x86-to-WASM compiler that lets you execute arbitrary binaries in the browser. Also a JVM to WASM transpiler. There's a fantastic Meetup presentation given by one of them where they show running a C++ multiplayer game with both client AND server running in a browser, using WebRTC as a networking polyfill. Really mindblowing: https://youtu.be/7JUs4c99-mo?t=167

At what point does the browser become an "os", what's next? Chrome hypervisor?

Not sure what you mean by hypervisor, but Microsoft does have... Microsoft Defender Application Guard, I believe it's called. It's a totally sandboxed version of Edge.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#38
post #33
post #28

Earlier quoted context omitted.

It can still be exploited the Applets/Flash way, by forcing the internal memory to become corrupted and with it change its behaviour.

It literally cannot.

I advise some courses in pentesting.

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#39
post #9

This company has an x86-to-WASM compiler that lets you execute arbitrary binaries in the browser. Also a JVM to WASM transpiler. There's a fantastic Meetup presentation given by one of them where they show running a C++ multiplayer game with both client AND server running in a browser, using WebRTC as a networking polyfill. Really mindblowing: https://youtu.be/7JUs4c99-mo?t=167

> running a C++ multiplayer game with both client AND server running in a browser, using WebRTC as a networking polyfill

Ok, now you have my attention. Been waiting for that possibility for a while!

Re: PartialExecuter: Reducing WebAssembly size by exploring all executions in LLVM

#40
post #36
post #28

Earlier quoted context omitted.

It can still be exploited the Applets/Flash way, by forcing the internal memory to become corrupted and with it change its behaviour.

Right, you can corrupt memory and thereby alter behavior, but that memory is a managed array. You can't corrupt anything outside of the application's own memory. As you say, you can change behavior, and thereby do whatever you want with whatever the wasm application is allowed to access. Which is a very limited set of things. Likening it to Java applets or Flash is deceptive -- yes, you can still hack them and exploi…

Imagine a WASM module used to control security authentication in the browser, or controlling IoT devices in a factory, now that it is fashionable to run WASM outside of the browser.
Post reply on HN