liveBook · Manning

Sandboxing

As explained in Server-Side WebAssembly

Sandboxing is a security technique that confines code to a restricted execution environment and limits its access to host resources.

Sandboxing confines code to a memory-safe execution environment and exposes host resources only through specific capabilities granted by the runtime. A Wasm module can print to standard output when permitted, but cannot otherwise access native operating-system interfaces or memory. section 1.2.4

A capability-based sandbox provides:

  • Explicit host interaction: the runtime grants narrow capabilities such as standard output instead of exposing all system calls. section 1.2.4
  • Component isolation: separately running modules reduce the chance that a compromised component can affect the rest of an application. section 1.2.4
  • Lightweight containment: Wasm provides built-in isolation with minimal overhead compared with containers and virtual machines. section 1.3

Application plugins

A host application can execute a plugin as an isolated Wasm module and grant only the capabilities it needs. This limits the damage a vulnerable plugin could cause while preserving portability across hosts. section 1.3

Figure 1.6 A native (traditional) application security model versus Wasm’s capability-based security model
A screenshot of a computer

AI-generated content may be incorrect.

Compare the traditional model, where native applications access operating-system calls and memory broadly, with Wasm’s capability-based security model. section 1.2.4

Sandboxing is especially valuable in cloud environments, where a supply-chain vulnerability can otherwise spread through shared resources. It does not remove every trade-off: Wasm still has limited multithreading support, and its package ecosystem includes incompatible components. section 1.2.4 section 1.3

How Server-Side WebAssembly covers it

How deep it goes
Explains memory-safe isolation, capability-controlled OS access, and supply-chain benefits, while stopping short of implementation commands or runtime configuration.
Examples
Uses controlled standard output, isolated cloud components, application plugins, and comparisons with containers and virtual machines.
What you can do after
Evaluate Wasm as an isolation mechanism for plugins and cloud components while recognizing multithreading and ecosystem limitations.
How it connects
Connects sandboxing with capability-based security, native applications, cloud computing, supply-chain attacks, containers, virtual machines, and application plugins.

Also explained in

Compare how 3 books explain sandboxing →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.