figma.com · Free post · Execution, roadmaps & process · Leadership & management

Server-side sandboxing: An introduction

FigmaOct 23, 20238 min
Sourcefigma.com
KindFree post
PublishedOct 23, 2023
Originalfigma.com ↗
N:

Figma's security team introduces server-side sandboxing as a defense-in-depth strategy for isolating risky workloads like image processing and data parsing that rely on memory-unsafe libraries. Rather than attempting to eliminate all vulnerabilities, sandboxing contains the blast radius of exploits by restricting what a compromised process can access. The article surveys three main approaches—virtual machines, containers, and seccomp—and provides a decision framework to help teams evaluate trade-offs between security strength, performance overhead, development cost, and operational complexity.

01Key takeaways

  • Sandboxing is a containment strategy, not a prevention strategy—it assumes bugs will happen and limits their blast radius.
  • Virtual machines offer strongest isolation but highest overhead; containers are lighter but require more careful configuration; seccomp is fastest for stateless computation.
  • Evaluate sandboxing by isolation granularity needed (per-job, per-user, per-organization) and acceptable latency and infrastructure cost trade-offs.
  • Development cost varies dramatically: seccomp requires deep expertise and code modification; containers are easier to deploy; VMs are often off-the-shelf solutions.
  • Operational overhead matters—consider whether your team can maintain the sandboxing infrastructure or if another team will own it.
  • Sandboxing enables shipping risky features safely by minimizing the cost of each new capability while protecting production infrastructure.

02Key sections

The sandboxing problem
Many SaaS features depend on third-party libraries written in memory-unsafe languages that handle untrusted user input, creating inevitable security risks. Rather than rewriting everything in safe languages, sandboxing mitigates the impact of bugs by containing compromised workloads and limiting their access to sensitive data and production systems.
Three sandboxing primitives
Virtual machines provide strong isolation via hypervisors but incur performance overhead; containers use OS-level features like namespaces for lighter-weight isolation; seccomp restricts system calls for pure-computation workloads with minimal overhead. Each trades off security strength, performance, and development complexity differently.
Evaluation framework
Teams should assess sandboxing options across four dimensions: environment requirements, security and performance needs, development costs and expertise, and maintenance overhead. The questionnaire helps match organizational constraints to the right isolation primitive.
Figma's approach
Figma uses Firecracker VMs via AWS Lambda for some workloads, nsjail containers for OS-level isolation, and custom seccomp allowlists for pure computation tasks, demonstrating how different primitives serve different risk profiles within a single product.
“It's expensive and unrealistic to rely entirely on preventing security vulnerabilities. Instead, we also use sandboxing to mitigate the impact.”Hongyi Hu & Max Serrano · figma.com
“The options outlined above all make different trade-offs between security, ease of development and maintenance, and runtime performance.”Hongyi Hu & Max Serrano · figma.com

03Frameworks mentioned

Summary and takeaways written by PM Atlas; quotes are short excerpts. © the original author.