Wasmer: Security model

Created on 27 Feb 2019  ·  7Comments  ·  Source: wasmerio/wasmer

Hello. I was wondering if you intend to support sandboxing and some kind of security model. If it's in the readme or other documentation, I apologize for missing it.

❓ question

Most helpful comment

@alexeypetrushin It’s on our roadmap to provide metering of memory/cpu instructions and preemption based on those values and possibly timeouts.

All 7 comments

Thanks for asking!

By design, webassembly is sandboxed by default. Aside from that, any sandboxing is really on the interface that's imported into your webassembly modules.

Our current emscripten implementation is not sandboxed whatsoever, but a strict security model is on our roadmap for future wasm abi implementations.

Sounds good. Since your home page shows starting a web server, I presumed that meant you had built in certain capabilities already. So I figured it was worth asking. Glad to hear it's in the plans. Maybe this or else more precise issues are worth keeping open until you have plans implemented and/or documented.

By design, webassembly is sandboxed by default

Is it possible to set CPU cycle limit and Memory limit?

It is possible to limit the memory size, yes. But it's not possible to limit the CPU frequency. I think it falls to the OS to slow down the Wasmer runtime process. I don't know yet how to do that though.

Thank you! Is it possible to limit the execution time (roughly, with precision like +-100milliseconds for example)?

As for the memory limit - can you please point me to docs or info how to specify it?

@alexeypetrushin It’s on our roadmap to provide metering of memory/cpu instructions and preemption based on those values and possibly timeouts.

It is possible to limit the memory size, yes.

How would you do that? I don't see and interface for that in wasmer_runtime::Module::instantiate.

In my tests, some Wasm was able to allocate 2x2 GB before hitting some kind of default limit.

Was this page helpful?
0 / 5 - 0 ratings