Server-side sandboxing: An introduction
Server-side workloads like image processing, parsing and thumbnailing often depend on memory-unsafe C++ libraries with histories of exploitable bugs (e.g. ImageTragick), so Figma isolates them with sandboxing rather than relying solely on preventing vulnerabilities. Three primitives are compared at a high level: VMs (Firecracker via AWS Lambda), containers (nsjail using namespaces, cgroups and seccomp), and direct seccomp syscall allowlists built with libseccomp for pure-computation workloads. Seccomp offers strong security and minimal overhead but high upfront development cost, while containers are easier to ship but have more security pitfalls. A questionnaire covering environment, isolation granularity, latency, cost, development effort and operational ownership helps teams choose an approach.
Related posts
- Server-side sandboxing: Containers and seccomp
Figma mediumAdept
Containers and seccomp offer lighter-weight sandboxing than VMs, but both shift much more configuration responsibility onto the user. Container escape risk depends on the runtime implementation, kernel primitives and configuration, and a sandboxed container still needs network, credential and data isolation to limit damage if compromised. Seccomp-only sandboxes suit pure-compute programs: Figma allows only writing to already-open file descriptors, exiting, memory allocation and fetching the time. Building allowlists with strace, restructuring programs so risky syscalls happen before untrusted input is processed, and maintaining brittle allowlists are the main costs, in exchange for very low overhead.
- Server-side sandboxing: Virtual machines
Figma mediumAdept
VM-based sandboxing rests on two boundaries: the hypervisor, which is usually strong but exposes a large attack surface, and the VM's own permissions, which must be restricted through network limits, minimal service access and short-lived credentials so a compromised job can't do harm without escaping. VMs run unmodified workloads, including third-party software, but cost more in cold starts, orchestration complexity and money than containers or seccomp. Figma runs image fetching and link-preview processing (including ImageMagick) in AWS Lambda on Firecracker, outside its production VPC and with no special privileges. The gotchas they hit were the Lambda localhost runtime API, which an SSRF could abuse, accidental IAM or VPC privileges, initial 10-second latencies, and the account-wide Lambda concurrency quota.
- Defense in Depth: How Replit Secures Every Layer of the Vibe Coding Stack
Replit easyNoviceReplit layers its security controls so that no single one is the last line of defense, from development sandboxes to production hosting. Internal services follow zero-trust principles: short-lived tokens and mTLS between service pairs. Sandboxes are seccomp-hardened Linux containers that are being migrated to microVMs, and Determinate Nix keeps dependencies patched. Dev and prod databases are separated with forkable snapshots, and an append-only git sidecar preserves history. A credential-injecting sidecar proxy keeps secrets and MCP OAuth tokens out of app code. Before publish, apps are scanned with combined SAST/SCA and LLM tooling, and each customer gets its own GCP project with Cloud Run and Cloud Armor.
- Comparing Different Approaches to Sandboxing
Docker easyNoviceAI agents need strong isolation because hallucinations and prompt injection can lead to destructive commands, and the common sandboxing options trade isolation against cost. chroot isolates only the filesystem and can be escaped by root processes. systemd-nspawn adds process and network isolation but is Linux-only. Containers need privileged mode for Docker-in-Docker, which weakens isolation, and full VMs like Lima cost about 4GB RAM and 30-60s boot per agent. MicroVMs with a dedicated guest kernel and gVisor's user-space syscall interception sit in between, and Docker Sandboxes is pitched as a cross-platform microVM option with hypervisor, network and per-sandbox Docker Engine isolation.
- WebAssembly and Back Again: Fine-Grained Sandboxing in Firefox 95
Mozilla Hacks mediumAdeptFirefox 95 ships RLBox, a fine-grained sandboxing technique that compiles third-party C/C++ libraries (Graphite, Hunspell, Ogg, with Expat and Woff2 following in 96) to WebAssembly and then back to native code, so untrusted code runs in-process but cannot jump to unexpected code or touch memory outside its region. This avoids the asynchrony refactoring and memory overhead of process-based isolation, needing only sanitization of values crossing the boundary via RLBox's tainting layer. The production pipeline replaced the Cranelift prototype with wasm2c, translating wasm to C and feeding it back into Clang, which preserves PGO, cross-boundary inlining, crash reporting and debugger support. Mozilla now pays bug bounties for sandbox escapes even without a library vulnerability.