Hacker News new | ask | show | jobs
by nequo 1166 days ago
I don't know about the limitations of sandboxing but I am curious. How does one break out of the JVM's or wasm's sandbox?
2 comments

The approach is the same in both cases - find an exposed API surface with a privileged implementation, find some way to confuse it, exploit.

In a few cases there were JVM exploits that weren't based on that approach, almost always involving reflection or JIT compiler bugs.

The people saying WASM is easier to sandbox than the JVM are sort of half right and half wrong. The hard part of sandboxing is exposing safe APIs to the sandboxed code. WASM solves that by simply not exposing any APIs at all. This essentially punts the sandbox construction to the user and will allow WASM vendors to claim a good security track record, which they will get by not doing very much.

On the other hand, the OpenJDK guys are retreating from providing any sandbox at all and are taking it out of new Java versions. So you'll end up with mandatory exposed APIs that don't even try to be safe.

Neither approach is really all that great if what you want is the ability to run a useful set of normal-ish programs in a safe way. GraalVM has its own sandboxing features which look like a decent compromise, and you can still use process or VM sandboxing on top.

I meant decent sandboxing on the JVM is not possible, that’s the advantage of WASM.